Auto-commit 2026-04-29 16:31
This commit is contained in:
68
node_modules/twilio/lib/rest/numbers/V1.d.ts
generated
vendored
Normal file
68
node_modules/twilio/lib/rest/numbers/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import NumbersBase from "../NumbersBase";
|
||||
import Version from "../../base/Version";
|
||||
import { BulkEligibilityListInstance } from "./v1/bulkEligibility";
|
||||
import { EligibilityListInstance } from "./v1/eligibility";
|
||||
import { EmbeddedSessionListInstance } from "./v1/embeddedSession";
|
||||
import { PortingAllPortInListInstance } from "./v1/portingAllPortIn";
|
||||
import { PortingPortInListInstance } from "./v1/portingPortIn";
|
||||
import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
|
||||
import { PortingPortabilityListInstance } from "./v1/portingPortability";
|
||||
import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration";
|
||||
import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete";
|
||||
import { SenderIdRegistrationListInstance } from "./v1/senderIdRegistration";
|
||||
import { SigningRequestConfigurationListInstance } from "./v1/signingRequestConfiguration";
|
||||
import { WebhookListInstance } from "./v1/webhook";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain: NumbersBase);
|
||||
/** bulkEligibilities - { Twilio.Numbers.V1.BulkEligibilityListInstance } resource */
|
||||
protected _bulkEligibilities?: BulkEligibilityListInstance;
|
||||
/** eligibilities - { Twilio.Numbers.V1.EligibilityListInstance } resource */
|
||||
protected _eligibilities?: EligibilityListInstance;
|
||||
/** portingAllPortIns - { Twilio.Numbers.V1.PortingAllPortInListInstance } resource */
|
||||
protected _portingAllPortIns?: PortingAllPortInListInstance;
|
||||
/** portingPortIns - { Twilio.Numbers.V1.PortingPortInListInstance } resource */
|
||||
protected _portingPortIns?: PortingPortInListInstance;
|
||||
/** portingPortInPhoneNumber - { Twilio.Numbers.V1.PortingPortInPhoneNumberListInstance } resource */
|
||||
protected _portingPortInPhoneNumber?: PortingPortInPhoneNumberListInstance;
|
||||
/** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */
|
||||
protected _portingPortabilities?: PortingPortabilityListInstance;
|
||||
/** portingWebhookConfigurations - { Twilio.Numbers.V1.PortingWebhookConfigurationListInstance } resource */
|
||||
protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance;
|
||||
/** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */
|
||||
protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance;
|
||||
/** senderIdRegistrations - { Twilio.Numbers.V1.SenderIdRegistrationListInstance } resource */
|
||||
protected _senderIdRegistrations?: SenderIdRegistrationListInstance;
|
||||
/** signingRequestConfigurations - { Twilio.Numbers.V1.SigningRequestConfigurationListInstance } resource */
|
||||
protected _signingRequestConfigurations?: SigningRequestConfigurationListInstance;
|
||||
/** webhook - { Twilio.Numbers.V1.WebhookListInstance } resource */
|
||||
protected _webhook?: WebhookListInstance;
|
||||
/** Getter for bulkEligibilities resource */
|
||||
get bulkEligibilities(): BulkEligibilityListInstance;
|
||||
/** Getter for eligibilities resource */
|
||||
get eligibilities(): EligibilityListInstance;
|
||||
/** Accessor for embeddedSessions resource */
|
||||
embeddedSessions(BundleSid: string): EmbeddedSessionListInstance;
|
||||
/** Getter for portingAllPortIns resource */
|
||||
get portingAllPortIns(): PortingAllPortInListInstance;
|
||||
/** Getter for portingPortIns resource */
|
||||
get portingPortIns(): PortingPortInListInstance;
|
||||
/** Getter for portingPortInPhoneNumber resource */
|
||||
get portingPortInPhoneNumber(): PortingPortInPhoneNumberListInstance;
|
||||
/** Getter for portingPortabilities resource */
|
||||
get portingPortabilities(): PortingPortabilityListInstance;
|
||||
/** Getter for portingWebhookConfigurations resource */
|
||||
get portingWebhookConfigurations(): PortingWebhookConfigurationListInstance;
|
||||
/** Getter for portingWebhookConfigurationsDelete resource */
|
||||
get portingWebhookConfigurationsDelete(): PortingWebhookConfigurationDeleteListInstance;
|
||||
/** Getter for senderIdRegistrations resource */
|
||||
get senderIdRegistrations(): SenderIdRegistrationListInstance;
|
||||
/** Getter for signingRequestConfigurations resource */
|
||||
get signingRequestConfigurations(): SigningRequestConfigurationListInstance;
|
||||
/** Getter for webhook resource */
|
||||
get webhook(): WebhookListInstance;
|
||||
}
|
||||
114
node_modules/twilio/lib/rest/numbers/V1.js
generated
vendored
Normal file
114
node_modules/twilio/lib/rest/numbers/V1.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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 bulkEligibility_1 = require("./v1/bulkEligibility");
|
||||
const eligibility_1 = require("./v1/eligibility");
|
||||
const embeddedSession_1 = require("./v1/embeddedSession");
|
||||
const portingAllPortIn_1 = require("./v1/portingAllPortIn");
|
||||
const portingPortIn_1 = require("./v1/portingPortIn");
|
||||
const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
|
||||
const portingPortability_1 = require("./v1/portingPortability");
|
||||
const portingWebhookConfiguration_1 = require("./v1/portingWebhookConfiguration");
|
||||
const portingWebhookConfigurationDelete_1 = require("./v1/portingWebhookConfigurationDelete");
|
||||
const senderIdRegistration_1 = require("./v1/senderIdRegistration");
|
||||
const signingRequestConfiguration_1 = require("./v1/signingRequestConfiguration");
|
||||
const webhook_1 = require("./v1/webhook");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for bulkEligibilities resource */
|
||||
get bulkEligibilities() {
|
||||
this._bulkEligibilities =
|
||||
this._bulkEligibilities || (0, bulkEligibility_1.BulkEligibilityListInstance)(this);
|
||||
return this._bulkEligibilities;
|
||||
}
|
||||
/** Getter for eligibilities resource */
|
||||
get eligibilities() {
|
||||
this._eligibilities = this._eligibilities || (0, eligibility_1.EligibilityListInstance)(this);
|
||||
return this._eligibilities;
|
||||
}
|
||||
/** Accessor for embeddedSessions resource */
|
||||
embeddedSessions(BundleSid) {
|
||||
return (0, embeddedSession_1.EmbeddedSessionListInstance)(this, BundleSid);
|
||||
}
|
||||
/** Getter for portingAllPortIns resource */
|
||||
get portingAllPortIns() {
|
||||
this._portingAllPortIns =
|
||||
this._portingAllPortIns || (0, portingAllPortIn_1.PortingAllPortInListInstance)(this);
|
||||
return this._portingAllPortIns;
|
||||
}
|
||||
/** Getter for portingPortIns resource */
|
||||
get portingPortIns() {
|
||||
this._portingPortIns =
|
||||
this._portingPortIns || (0, portingPortIn_1.PortingPortInListInstance)(this);
|
||||
return this._portingPortIns;
|
||||
}
|
||||
/** Getter for portingPortInPhoneNumber resource */
|
||||
get portingPortInPhoneNumber() {
|
||||
this._portingPortInPhoneNumber =
|
||||
this._portingPortInPhoneNumber ||
|
||||
(0, portingPortInPhoneNumber_1.PortingPortInPhoneNumberListInstance)(this);
|
||||
return this._portingPortInPhoneNumber;
|
||||
}
|
||||
/** Getter for portingPortabilities resource */
|
||||
get portingPortabilities() {
|
||||
this._portingPortabilities =
|
||||
this._portingPortabilities || (0, portingPortability_1.PortingPortabilityListInstance)(this);
|
||||
return this._portingPortabilities;
|
||||
}
|
||||
/** Getter for portingWebhookConfigurations resource */
|
||||
get portingWebhookConfigurations() {
|
||||
this._portingWebhookConfigurations =
|
||||
this._portingWebhookConfigurations ||
|
||||
(0, portingWebhookConfiguration_1.PortingWebhookConfigurationListInstance)(this);
|
||||
return this._portingWebhookConfigurations;
|
||||
}
|
||||
/** Getter for portingWebhookConfigurationsDelete resource */
|
||||
get portingWebhookConfigurationsDelete() {
|
||||
this._portingWebhookConfigurationsDelete =
|
||||
this._portingWebhookConfigurationsDelete ||
|
||||
(0, portingWebhookConfigurationDelete_1.PortingWebhookConfigurationDeleteListInstance)(this);
|
||||
return this._portingWebhookConfigurationsDelete;
|
||||
}
|
||||
/** Getter for senderIdRegistrations resource */
|
||||
get senderIdRegistrations() {
|
||||
this._senderIdRegistrations =
|
||||
this._senderIdRegistrations || (0, senderIdRegistration_1.SenderIdRegistrationListInstance)(this);
|
||||
return this._senderIdRegistrations;
|
||||
}
|
||||
/** Getter for signingRequestConfigurations resource */
|
||||
get signingRequestConfigurations() {
|
||||
this._signingRequestConfigurations =
|
||||
this._signingRequestConfigurations ||
|
||||
(0, signingRequestConfiguration_1.SigningRequestConfigurationListInstance)(this);
|
||||
return this._signingRequestConfigurations;
|
||||
}
|
||||
/** Getter for webhook resource */
|
||||
get webhook() {
|
||||
this._webhook = this._webhook || (0, webhook_1.WebhookListInstance)(this);
|
||||
return this._webhook;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
40
node_modules/twilio/lib/rest/numbers/V2.d.ts
generated
vendored
Normal file
40
node_modules/twilio/lib/rest/numbers/V2.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import NumbersBase from "../NumbersBase";
|
||||
import Version from "../../base/Version";
|
||||
import { ApplicationListInstance } from "./v2/application";
|
||||
import { AuthorizationDocumentListInstance } from "./v2/authorizationDocument";
|
||||
import { BulkHostedNumberOrderListInstance } from "./v2/bulkHostedNumberOrder";
|
||||
import { BundleCloneListInstance } from "./v2/bundleClone";
|
||||
import { HostedNumberOrderListInstance } from "./v2/hostedNumberOrder";
|
||||
import { RegulatoryComplianceListInstance } from "./v2/regulatoryCompliance";
|
||||
export default class V2 extends Version {
|
||||
/**
|
||||
* Initialize the V2 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain: NumbersBase);
|
||||
/** applications - { Twilio.Numbers.V2.ApplicationListInstance } resource */
|
||||
protected _applications?: ApplicationListInstance;
|
||||
/** authorizationDocuments - { Twilio.Numbers.V2.AuthorizationDocumentListInstance } resource */
|
||||
protected _authorizationDocuments?: AuthorizationDocumentListInstance;
|
||||
/** bulkHostedNumberOrders - { Twilio.Numbers.V2.BulkHostedNumberOrderListInstance } resource */
|
||||
protected _bulkHostedNumberOrders?: BulkHostedNumberOrderListInstance;
|
||||
/** bundleClone - { Twilio.Numbers.V2.BundleCloneListInstance } resource */
|
||||
protected _bundleClone?: BundleCloneListInstance;
|
||||
/** hostedNumberOrders - { Twilio.Numbers.V2.HostedNumberOrderListInstance } resource */
|
||||
protected _hostedNumberOrders?: HostedNumberOrderListInstance;
|
||||
/** regulatoryCompliance - { Twilio.Numbers.V2.RegulatoryComplianceListInstance } resource */
|
||||
protected _regulatoryCompliance?: RegulatoryComplianceListInstance;
|
||||
/** Getter for applications resource */
|
||||
get applications(): ApplicationListInstance;
|
||||
/** Getter for authorizationDocuments resource */
|
||||
get authorizationDocuments(): AuthorizationDocumentListInstance;
|
||||
/** Getter for bulkHostedNumberOrders resource */
|
||||
get bulkHostedNumberOrders(): BulkHostedNumberOrderListInstance;
|
||||
/** Getter for bundleClone resource */
|
||||
get bundleClone(): BundleCloneListInstance;
|
||||
/** Getter for hostedNumberOrders resource */
|
||||
get hostedNumberOrders(): HostedNumberOrderListInstance;
|
||||
/** Getter for regulatoryCompliance resource */
|
||||
get regulatoryCompliance(): RegulatoryComplianceListInstance;
|
||||
}
|
||||
70
node_modules/twilio/lib/rest/numbers/V2.js
generated
vendored
Normal file
70
node_modules/twilio/lib/rest/numbers/V2.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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 application_1 = require("./v2/application");
|
||||
const authorizationDocument_1 = require("./v2/authorizationDocument");
|
||||
const bulkHostedNumberOrder_1 = require("./v2/bulkHostedNumberOrder");
|
||||
const bundleClone_1 = require("./v2/bundleClone");
|
||||
const hostedNumberOrder_1 = require("./v2/hostedNumberOrder");
|
||||
const regulatoryCompliance_1 = require("./v2/regulatoryCompliance");
|
||||
class V2 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V2 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v2");
|
||||
}
|
||||
/** Getter for applications resource */
|
||||
get applications() {
|
||||
this._applications = this._applications || (0, application_1.ApplicationListInstance)(this);
|
||||
return this._applications;
|
||||
}
|
||||
/** Getter for authorizationDocuments resource */
|
||||
get authorizationDocuments() {
|
||||
this._authorizationDocuments =
|
||||
this._authorizationDocuments || (0, authorizationDocument_1.AuthorizationDocumentListInstance)(this);
|
||||
return this._authorizationDocuments;
|
||||
}
|
||||
/** Getter for bulkHostedNumberOrders resource */
|
||||
get bulkHostedNumberOrders() {
|
||||
this._bulkHostedNumberOrders =
|
||||
this._bulkHostedNumberOrders || (0, bulkHostedNumberOrder_1.BulkHostedNumberOrderListInstance)(this);
|
||||
return this._bulkHostedNumberOrders;
|
||||
}
|
||||
/** Getter for bundleClone resource */
|
||||
get bundleClone() {
|
||||
this._bundleClone = this._bundleClone || (0, bundleClone_1.BundleCloneListInstance)(this);
|
||||
return this._bundleClone;
|
||||
}
|
||||
/** Getter for hostedNumberOrders resource */
|
||||
get hostedNumberOrders() {
|
||||
this._hostedNumberOrders =
|
||||
this._hostedNumberOrders || (0, hostedNumberOrder_1.HostedNumberOrderListInstance)(this);
|
||||
return this._hostedNumberOrders;
|
||||
}
|
||||
/** Getter for regulatoryCompliance resource */
|
||||
get regulatoryCompliance() {
|
||||
this._regulatoryCompliance =
|
||||
this._regulatoryCompliance || (0, regulatoryCompliance_1.RegulatoryComplianceListInstance)(this);
|
||||
return this._regulatoryCompliance;
|
||||
}
|
||||
}
|
||||
exports.default = V2;
|
||||
15
node_modules/twilio/lib/rest/numbers/V3.d.ts
generated
vendored
Normal file
15
node_modules/twilio/lib/rest/numbers/V3.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import NumbersBase from "../NumbersBase";
|
||||
import Version from "../../base/Version";
|
||||
import { HostedNumberOrderListInstance } from "./v3/hostedNumberOrder";
|
||||
export default class V3 extends Version {
|
||||
/**
|
||||
* Initialize the V3 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain: NumbersBase);
|
||||
/** hostedNumberOrders - { Twilio.Numbers.V3.HostedNumberOrderListInstance } resource */
|
||||
protected _hostedNumberOrders?: HostedNumberOrderListInstance;
|
||||
/** Getter for hostedNumberOrders resource */
|
||||
get hostedNumberOrders(): HostedNumberOrderListInstance;
|
||||
}
|
||||
37
node_modules/twilio/lib/rest/numbers/V3.js
generated
vendored
Normal file
37
node_modules/twilio/lib/rest/numbers/V3.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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 hostedNumberOrder_1 = require("./v3/hostedNumberOrder");
|
||||
class V3 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V3 version of Numbers
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Numbers) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v3");
|
||||
}
|
||||
/** Getter for hostedNumberOrders resource */
|
||||
get hostedNumberOrders() {
|
||||
this._hostedNumberOrders =
|
||||
this._hostedNumberOrders || (0, hostedNumberOrder_1.HostedNumberOrderListInstance)(this);
|
||||
return this._hostedNumberOrders;
|
||||
}
|
||||
}
|
||||
exports.default = V3;
|
||||
172
node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts
generated
vendored
Normal file
172
node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a BulkEligibilityInstance
|
||||
*/
|
||||
export interface BulkEligibilityListInstanceCreateOptions {
|
||||
/** */
|
||||
body?: object;
|
||||
}
|
||||
export interface BulkEligibilityContext {
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise<BulkEligibilityInstance>;
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkEligibilityInstance>) => any): Promise<ApiResponse<BulkEligibilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface BulkEligibilityContextSolution {
|
||||
requestId: string;
|
||||
}
|
||||
export declare class BulkEligibilityContextImpl implements BulkEligibilityContext {
|
||||
protected _version: V1;
|
||||
protected _solution: BulkEligibilityContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, requestId: string);
|
||||
fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise<BulkEligibilityInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkEligibilityInstance>) => any): Promise<ApiResponse<BulkEligibilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): BulkEligibilityContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface BulkEligibilityResource {
|
||||
request_id: string;
|
||||
url: string;
|
||||
results: Array<any>;
|
||||
friendly_name: string;
|
||||
status: string;
|
||||
date_created: Date;
|
||||
date_completed: Date;
|
||||
}
|
||||
export declare class BulkEligibilityInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: BulkEligibilityContextSolution;
|
||||
protected _context?: BulkEligibilityContext;
|
||||
constructor(_version: V1, payload: BulkEligibilityResource, requestId?: string);
|
||||
/**
|
||||
* The SID of the bulk eligibility check that you want to know about.
|
||||
*/
|
||||
requestId: string;
|
||||
/**
|
||||
* This is the url of the request that you\'re trying to reach out to locate the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The result set that contains the eligibility check response for each requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number\'s ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status.
|
||||
*/
|
||||
results: Array<any>;
|
||||
/**
|
||||
* This is the string that you assigned as a friendly name for describing the eligibility check request.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* This is the status of the bulk eligibility check request. (Example: COMPLETE, IN_PROGRESS)
|
||||
*/
|
||||
status: string;
|
||||
dateCreated: Date;
|
||||
dateCompleted: Date;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise<BulkEligibilityInstance>;
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkEligibilityInstance>) => any): Promise<ApiResponse<BulkEligibilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
requestId: string;
|
||||
url: string;
|
||||
results: any[];
|
||||
friendlyName: string;
|
||||
status: string;
|
||||
dateCreated: Date;
|
||||
dateCompleted: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface BulkEligibilitySolution {
|
||||
}
|
||||
export interface BulkEligibilityListInstance {
|
||||
_version: V1;
|
||||
_solution: BulkEligibilitySolution;
|
||||
_uri: string;
|
||||
(requestId: string): BulkEligibilityContext;
|
||||
get(requestId: string): BulkEligibilityContext;
|
||||
/**
|
||||
* Create a BulkEligibilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise<BulkEligibilityInstance>;
|
||||
/**
|
||||
* Create a BulkEligibilityInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance
|
||||
*/
|
||||
create(params: object, headers?: any, callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise<BulkEligibilityInstance>;
|
||||
/**
|
||||
* Create a BulkEligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkEligibilityInstance>) => any): Promise<ApiResponse<BulkEligibilityInstance>>;
|
||||
/**
|
||||
* Create a BulkEligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: object, headers?: any, callback?: (error: Error | null, item?: ApiResponse<BulkEligibilityInstance>) => any): Promise<ApiResponse<BulkEligibilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BulkEligibilityListInstance(version: V1): BulkEligibilityListInstance;
|
||||
export {};
|
||||
206
node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js
generated
vendored
Normal file
206
node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js
generated
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.BulkEligibilityInstance = exports.BulkEligibilityContextImpl = void 0;
|
||||
exports.BulkEligibilityListInstance = BulkEligibilityListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class BulkEligibilityContextImpl {
|
||||
constructor(_version, requestId) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(requestId)) {
|
||||
throw new Error("Parameter 'requestId' is not valid.");
|
||||
}
|
||||
this._solution = { requestId };
|
||||
this._uri = `/HostedNumber/Eligibility/Bulk/${requestId}`;
|
||||
}
|
||||
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 BulkEligibilityInstance(operationVersion, payload, instance._solution.requestId));
|
||||
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 BulkEligibilityInstance(operationVersion, response.body, instance._solution.requestId),
|
||||
}));
|
||||
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.BulkEligibilityContextImpl = BulkEligibilityContextImpl;
|
||||
class BulkEligibilityInstance {
|
||||
constructor(_version, payload, requestId) {
|
||||
this._version = _version;
|
||||
this.requestId = payload.request_id;
|
||||
this.url = payload.url;
|
||||
this.results = payload.results;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed);
|
||||
this._solution = { requestId: requestId || this.requestId };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new BulkEligibilityContextImpl(this._version, this._solution.requestId);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a BulkEligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkEligibilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
requestId: this.requestId,
|
||||
url: this.url,
|
||||
results: this.results,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
dateCompleted: this.dateCompleted,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BulkEligibilityInstance = BulkEligibilityInstance;
|
||||
function BulkEligibilityListInstance(version) {
|
||||
const instance = ((requestId) => instance.get(requestId));
|
||||
instance.get = function get(requestId) {
|
||||
return new BulkEligibilityContextImpl(version, requestId);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumber/Eligibility/Bulk`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new BulkEligibilityInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 BulkEligibilityInstance(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;
|
||||
}
|
||||
80
node_modules/twilio/lib/rest/numbers/v1/eligibility.d.ts
generated
vendored
Normal file
80
node_modules/twilio/lib/rest/numbers/v1/eligibility.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a EligibilityInstance
|
||||
*/
|
||||
export interface EligibilityListInstanceCreateOptions {
|
||||
/** */
|
||||
body?: object;
|
||||
}
|
||||
export interface EligibilitySolution {
|
||||
}
|
||||
export interface EligibilityListInstance {
|
||||
_version: V1;
|
||||
_solution: EligibilitySolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a EligibilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EligibilityInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: EligibilityInstance) => any): Promise<EligibilityInstance>;
|
||||
/**
|
||||
* Create a EligibilityInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EligibilityInstance
|
||||
*/
|
||||
create(params: object, headers?: any, callback?: (error: Error | null, item?: EligibilityInstance) => any): Promise<EligibilityInstance>;
|
||||
/**
|
||||
* Create a EligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EligibilityInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EligibilityInstance>) => any): Promise<ApiResponse<EligibilityInstance>>;
|
||||
/**
|
||||
* Create a EligibilityInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EligibilityInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: object, headers?: any, callback?: (error: Error | null, item?: ApiResponse<EligibilityInstance>) => any): Promise<ApiResponse<EligibilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function EligibilityListInstance(version: V1): EligibilityListInstance;
|
||||
interface EligibilityResource {
|
||||
results: Array<any>;
|
||||
}
|
||||
export declare class EligibilityInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: EligibilityResource);
|
||||
/**
|
||||
* The result set that contains the eligibility check response for the requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number\'s ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status.
|
||||
*/
|
||||
results: Array<any>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
results: any[];
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
109
node_modules/twilio/lib/rest/numbers/v1/eligibility.js
generated
vendored
Normal file
109
node_modules/twilio/lib/rest/numbers/v1/eligibility.js
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.EligibilityInstance = void 0;
|
||||
exports.EligibilityListInstance = EligibilityListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function EligibilityListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumber/Eligibility`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new EligibilityInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 EligibilityInstance(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 EligibilityInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.results = payload.results;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
results: this.results,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EligibilityInstance = EligibilityInstance;
|
||||
84
node_modules/twilio/lib/rest/numbers/v1/embeddedSession.d.ts
generated
vendored
Normal file
84
node_modules/twilio/lib/rest/numbers/v1/embeddedSession.d.ts
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export declare class NumbersV1CreateEmbeddedSessionRequest {
|
||||
/**
|
||||
* Theme ID for the Compliance Embeddable UI. Overrides the theme set during registration creation.
|
||||
*/
|
||||
"themeSetId"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a EmbeddedSessionInstance
|
||||
*/
|
||||
export interface EmbeddedSessionListInstanceCreateOptions {
|
||||
/** */
|
||||
numbersV1CreateEmbeddedSessionRequest: NumbersV1CreateEmbeddedSessionRequest;
|
||||
}
|
||||
export interface EmbeddedSessionSolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export interface EmbeddedSessionListInstance {
|
||||
_version: V1;
|
||||
_solution: EmbeddedSessionSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a EmbeddedSessionInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EmbeddedSessionInstance
|
||||
*/
|
||||
create(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: EmbeddedSessionInstance) => any): Promise<EmbeddedSessionInstance>;
|
||||
/**
|
||||
* Create a EmbeddedSessionInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EmbeddedSessionInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<EmbeddedSessionInstance>) => any): Promise<ApiResponse<EmbeddedSessionInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function EmbeddedSessionListInstance(version: V1, bundleSid: string): EmbeddedSessionListInstance;
|
||||
interface EmbeddedSessionResource {
|
||||
id: string;
|
||||
sessionId: string;
|
||||
sessionToken: string;
|
||||
}
|
||||
export declare class EmbeddedSessionInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: EmbeddedSessionResource, bundleSid?: string);
|
||||
/**
|
||||
* Registration identifier (BU-prefixed).
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Session ID for the compliance embeddable.
|
||||
*/
|
||||
sessionId: string;
|
||||
/**
|
||||
* Ephemeral session token for the compliance embeddable.
|
||||
*/
|
||||
sessionToken: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
id: string;
|
||||
sessionId: string;
|
||||
sessionToken: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
115
node_modules/twilio/lib/rest/numbers/v1/embeddedSession.js
generated
vendored
Normal file
115
node_modules/twilio/lib/rest/numbers/v1/embeddedSession.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.EmbeddedSessionInstance = exports.NumbersV1CreateEmbeddedSessionRequest = void 0;
|
||||
exports.EmbeddedSessionListInstance = EmbeddedSessionListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class NumbersV1CreateEmbeddedSessionRequest {
|
||||
constructor(payload) {
|
||||
this.themeSetId = payload["themeSetId"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1CreateEmbeddedSessionRequest = NumbersV1CreateEmbeddedSessionRequest;
|
||||
function EmbeddedSessionListInstance(version, bundleSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { bundleSid };
|
||||
instance._uri = `/SenderIdRegistrations/${bundleSid}/EmbeddedSessions`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new EmbeddedSessionInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 EmbeddedSessionInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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 EmbeddedSessionInstance {
|
||||
constructor(_version, payload, bundleSid) {
|
||||
this._version = _version;
|
||||
this.id = payload.id;
|
||||
this.sessionId = payload.sessionId;
|
||||
this.sessionToken = payload.sessionToken;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
sessionId: this.sessionId,
|
||||
sessionToken: this.sessionToken,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EmbeddedSessionInstance = EmbeddedSessionInstance;
|
||||
254
node_modules/twilio/lib/rest/numbers/v1/portingAllPortIn.d.ts
generated
vendored
Normal file
254
node_modules/twilio/lib/rest/numbers/v1/portingAllPortIn.d.ts
generated
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
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 PortingAllPortInListInstanceEachOptions {
|
||||
/** Page start token, if null then it will start from the beginning */
|
||||
token?: string;
|
||||
/** Number of items per page */
|
||||
size?: number;
|
||||
/** Filter by Port in request SID, supports multiple values separated by comma */
|
||||
portInRequestSid?: string;
|
||||
/** Filter by Port In request status */
|
||||
portInRequestStatus?: string;
|
||||
/** Find all created before a certain date */
|
||||
createdBefore?: string;
|
||||
/** Find all created after a certain date */
|
||||
createdAfter?: string;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: PortingAllPortInInstance, 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 PortingAllPortInListInstanceOptions {
|
||||
/** Page start token, if null then it will start from the beginning */
|
||||
token?: string;
|
||||
/** Number of items per page */
|
||||
size?: number;
|
||||
/** Filter by Port in request SID, supports multiple values separated by comma */
|
||||
portInRequestSid?: string;
|
||||
/** Filter by Port In request status */
|
||||
portInRequestStatus?: string;
|
||||
/** Find all created before a certain date */
|
||||
createdBefore?: string;
|
||||
/** Find all created after a certain date */
|
||||
createdAfter?: string;
|
||||
/** 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 PortingAllPortInListInstancePageOptions {
|
||||
/** Page start token, if null then it will start from the beginning */
|
||||
token?: string;
|
||||
/** Number of items per page */
|
||||
size?: number;
|
||||
/** Filter by Port in request SID, supports multiple values separated by comma */
|
||||
portInRequestSid?: string;
|
||||
/** Filter by Port In request status */
|
||||
portInRequestStatus?: string;
|
||||
/** Find all created before a certain date */
|
||||
createdBefore?: string;
|
||||
/** Find all created after a certain date */
|
||||
createdAfter?: string;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface PortingAllPortInSolution {
|
||||
}
|
||||
export interface PortingAllPortInListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingAllPortInSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Streams PortingAllPortInInstance 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 { PortingAllPortInListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: PortingAllPortInInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: PortingAllPortInListInstanceEachOptions, callback?: (item: PortingAllPortInInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams PortingAllPortInInstance 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 { PortingAllPortInListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: PortingAllPortInInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: PortingAllPortInListInstanceEachOptions, callback?: (item: PortingAllPortInInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of PortingAllPortInInstance 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: PortingAllPortInPage) => any): Promise<PortingAllPortInPage>;
|
||||
/**
|
||||
* Retrieve a single target page of PortingAllPortInInstance 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<PortingAllPortInPage>) => any): Promise<ApiResponse<PortingAllPortInPage>>;
|
||||
/**
|
||||
* Lists PortingAllPortInInstance 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 { PortingAllPortInListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: PortingAllPortInInstance[]) => any): Promise<PortingAllPortInInstance[]>;
|
||||
list(params: PortingAllPortInListInstanceOptions, callback?: (error: Error | null, items: PortingAllPortInInstance[]) => any): Promise<PortingAllPortInInstance[]>;
|
||||
/**
|
||||
* Lists PortingAllPortInInstance 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 { PortingAllPortInListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<PortingAllPortInInstance[]>) => any): Promise<ApiResponse<PortingAllPortInInstance[]>>;
|
||||
listWithHttpInfo(params: PortingAllPortInListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<PortingAllPortInInstance[]>) => any): Promise<ApiResponse<PortingAllPortInInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of PortingAllPortInInstance 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 { PortingAllPortInListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: PortingAllPortInPage) => any): Promise<PortingAllPortInPage>;
|
||||
page(params: PortingAllPortInListInstancePageOptions, callback?: (error: Error | null, items: PortingAllPortInPage) => any): Promise<PortingAllPortInPage>;
|
||||
/**
|
||||
* Retrieve a single page of PortingAllPortInInstance 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 { PortingAllPortInListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<PortingAllPortInPage>) => any): Promise<ApiResponse<PortingAllPortInPage>>;
|
||||
pageWithHttpInfo(params: PortingAllPortInListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<PortingAllPortInPage>) => any): Promise<ApiResponse<PortingAllPortInPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingAllPortInListInstance(version: V1): PortingAllPortInListInstance;
|
||||
interface PortingAllPortInPayload extends TwilioResponsePayload {
|
||||
port_in_requests: PortingAllPortInResource[];
|
||||
}
|
||||
interface PortingAllPortInResource {
|
||||
port_in_request_sid: string;
|
||||
port_in_request_status: string;
|
||||
status_last_updated_timestamp: string;
|
||||
phone_numbers_requested: number;
|
||||
phone_numbers_ported: number;
|
||||
suggested_action: string;
|
||||
}
|
||||
export declare class PortingAllPortInInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: PortingAllPortInResource);
|
||||
/**
|
||||
* The SID of the Port-in request
|
||||
*/
|
||||
portInRequestSid: string;
|
||||
/**
|
||||
* Status of the Port In Request
|
||||
*/
|
||||
portInRequestStatus: string;
|
||||
/**
|
||||
* The last updated timestamp of the request
|
||||
*/
|
||||
statusLastUpdatedTimestamp: string;
|
||||
/**
|
||||
* Amount of phone numbers requested
|
||||
*/
|
||||
phoneNumbersRequested: number;
|
||||
/**
|
||||
* Amount of phone numbers ported
|
||||
*/
|
||||
phoneNumbersPorted: number;
|
||||
/**
|
||||
* Suggested action on this ticket
|
||||
*/
|
||||
suggestedAction: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
portInRequestSid: string;
|
||||
portInRequestStatus: string;
|
||||
statusLastUpdatedTimestamp: string;
|
||||
phoneNumbersRequested: number;
|
||||
phoneNumbersPorted: number;
|
||||
suggestedAction: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class PortingAllPortInPage extends Page<V1, PortingAllPortInPayload, PortingAllPortInResource, PortingAllPortInInstance> {
|
||||
/**
|
||||
* Initialize the PortingAllPortInPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: PortingAllPortInSolution);
|
||||
/**
|
||||
* Build an instance of PortingAllPortInInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: PortingAllPortInResource): PortingAllPortInInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
197
node_modules/twilio/lib/rest/numbers/v1/portingAllPortIn.js
generated
vendored
Normal file
197
node_modules/twilio/lib/rest/numbers/v1/portingAllPortIn.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingAllPortInPage = exports.PortingAllPortInInstance = void 0;
|
||||
exports.PortingAllPortInListInstance = PortingAllPortInListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function PortingAllPortInListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Porting/PortIn/PortInRequests`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["token"] !== undefined)
|
||||
data["Token"] = params["token"];
|
||||
if (params["size"] !== undefined)
|
||||
data["Size"] = params["size"];
|
||||
if (params["portInRequestSid"] !== undefined)
|
||||
data["PortInRequestSid"] = params["portInRequestSid"];
|
||||
if (params["portInRequestStatus"] !== undefined)
|
||||
data["PortInRequestStatus"] = params["portInRequestStatus"];
|
||||
if (params["createdBefore"] !== undefined)
|
||||
data["CreatedBefore"] = params["createdBefore"];
|
||||
if (params["createdAfter"] !== undefined)
|
||||
data["CreatedAfter"] = params["createdAfter"];
|
||||
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 PortingAllPortInPage(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 PortingAllPortInPage(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["token"] !== undefined)
|
||||
data["Token"] = params["token"];
|
||||
if (params["size"] !== undefined)
|
||||
data["Size"] = params["size"];
|
||||
if (params["portInRequestSid"] !== undefined)
|
||||
data["PortInRequestSid"] = params["portInRequestSid"];
|
||||
if (params["portInRequestStatus"] !== undefined)
|
||||
data["PortInRequestStatus"] = params["portInRequestStatus"];
|
||||
if (params["createdBefore"] !== undefined)
|
||||
data["CreatedBefore"] = params["createdBefore"];
|
||||
if (params["createdAfter"] !== undefined)
|
||||
data["CreatedAfter"] = params["createdAfter"];
|
||||
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 PortingAllPortInPage(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 PortingAllPortInPage(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 PortingAllPortInInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.portInRequestSid = payload.port_in_request_sid;
|
||||
this.portInRequestStatus = payload.port_in_request_status;
|
||||
this.statusLastUpdatedTimestamp = payload.status_last_updated_timestamp;
|
||||
this.phoneNumbersRequested = deserialize.integer(payload.phone_numbers_requested);
|
||||
this.phoneNumbersPorted = deserialize.integer(payload.phone_numbers_ported);
|
||||
this.suggestedAction = payload.suggested_action;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
portInRequestSid: this.portInRequestSid,
|
||||
portInRequestStatus: this.portInRequestStatus,
|
||||
statusLastUpdatedTimestamp: this.statusLastUpdatedTimestamp,
|
||||
phoneNumbersRequested: this.phoneNumbersRequested,
|
||||
phoneNumbersPorted: this.phoneNumbersPorted,
|
||||
suggestedAction: this.suggestedAction,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingAllPortInInstance = PortingAllPortInInstance;
|
||||
class PortingAllPortInPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the PortingAllPortInPage
|
||||
*
|
||||
* @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 PortingAllPortInInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new PortingAllPortInInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingAllPortInPage = PortingAllPortInPage;
|
||||
416
node_modules/twilio/lib/rest/numbers/v1/portingPortIn.d.ts
generated
vendored
Normal file
416
node_modules/twilio/lib/rest/numbers/v1/portingPortIn.d.ts
generated
vendored
Normal file
@@ -0,0 +1,416 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export declare class NumbersV1PortingAddress {
|
||||
/**
|
||||
* The street address, ex: 101 Spear St
|
||||
*/
|
||||
"street": string;
|
||||
/**
|
||||
* The building information, ex : 5th floor.
|
||||
*/
|
||||
"street2"?: string;
|
||||
/**
|
||||
* The city name, ex: San Francisco.
|
||||
*/
|
||||
"city": string;
|
||||
/**
|
||||
* The state name, ex: CA or California. Note this should match the losing carrier’s information exactly. So if they spell out the entire state’s name instead of abbreviating it, please do so.
|
||||
*/
|
||||
"state": string;
|
||||
/**
|
||||
* The zip code, ex: 94105.
|
||||
*/
|
||||
"zip": string;
|
||||
/**
|
||||
* The country, ex: USA.
|
||||
*/
|
||||
"country": string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class NumbersV1PortingLosingCarrierInformation {
|
||||
/**
|
||||
* Customer name as it is registered with the losing carrier. This can be an individual or a business name depending on the customer type selected.
|
||||
*/
|
||||
"customerName": string;
|
||||
/**
|
||||
* The account number of the customer for the losing carrier. Only require for mobile phone numbers.
|
||||
*/
|
||||
"accountNumber"?: string;
|
||||
/**
|
||||
* The account phone number of the customer for the losing carrier.
|
||||
*/
|
||||
"accountTelephoneNumber"?: string;
|
||||
/**
|
||||
* If you already have an Address SID that represents the address needed for the LOA, you can provide an Address SID instead of providing the address object in the request body. This will copy the address into the port in request. If changes are made to the Address SID after port in request creation, those changes will not be reflected in the port in request.
|
||||
*/
|
||||
"addressSid"?: string;
|
||||
"address"?: NumbersV1PortingAddress;
|
||||
/**
|
||||
* The first and last name of the person listed with the losing carrier who is authorized to make changes on the account.
|
||||
*/
|
||||
"authorizedRepresentative": string;
|
||||
/**
|
||||
* Email address of the person (owner of the number) who will sign the letter of authorization for the port in request. This email address should belong to the person named in as the authorized representative.
|
||||
*/
|
||||
"authorizedRepresentativeEmail": string;
|
||||
/**
|
||||
* The type of customer account in the losing carrier. This should either be: \'Individual\' or \'Business\'.
|
||||
*/
|
||||
"customerType"?: string;
|
||||
"authorizedRepresentativeKatakana"?: string;
|
||||
"subMunicipality"?: string;
|
||||
"building"?: string;
|
||||
"katakanaName"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class NumbersV1PortingPortInCreate {
|
||||
/**
|
||||
* Account Sid or subaccount where the phone number(s) will be Ported
|
||||
*/
|
||||
"accountSid": string;
|
||||
/**
|
||||
* List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.
|
||||
*/
|
||||
"documents": Array<string>;
|
||||
/**
|
||||
* List of phone numbers to be ported. Maximum of 1,000 phone numbers per request.
|
||||
*/
|
||||
"phoneNumbers"?: Array<NumbersV1PortingPortInCreatePhoneNumbers>;
|
||||
"losingCarrierInformation": NumbersV1PortingLosingCarrierInformation;
|
||||
/**
|
||||
* Additional emails to send a copy of the signed LOA to.
|
||||
*/
|
||||
"notificationEmails"?: Array<string> | null;
|
||||
/**
|
||||
* Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can\'t guarantee the exact date and time, as this depends on the losing carrier
|
||||
*/
|
||||
"targetPortInDate"?: string | null;
|
||||
/**
|
||||
* The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00\'. We can\'t guarantee the exact date and time, as this depends on the losing carrier
|
||||
*/
|
||||
"targetPortInTimeRangeStart"?: string | null;
|
||||
/**
|
||||
* The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00\'. We can\'t guarantee the exact date and time, as this depends on the losing carrier
|
||||
*/
|
||||
"targetPortInTimeRangeEnd"?: string | null;
|
||||
/**
|
||||
* The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.
|
||||
*/
|
||||
"bundleSid"?: string | null;
|
||||
/**
|
||||
* A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.
|
||||
*/
|
||||
"portabilityAdvanceCarrier"?: string | null;
|
||||
/**
|
||||
* Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.
|
||||
*/
|
||||
"autoCancelApprovalNumbers"?: string | null;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class NumbersV1PortingPortInCreatePhoneNumbers {
|
||||
/**
|
||||
* Phone number to be ported. This must be in the E164 Format.
|
||||
*/
|
||||
"phoneNumber": string;
|
||||
/**
|
||||
* Some losing carriers require a PIN to authorize the port of a phone number. If the phone number is a US mobile phone number, the PIN is mandatory to process a porting request. Other carriers and number types may also require a PIN, you\'ll need to contact the losing carrier to determine what your phone number\'s PIN is.
|
||||
*/
|
||||
"pin"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class NumbersV1PortingPortInPhoneNumberResult {
|
||||
/**
|
||||
* The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
"notPortabilityReason"?: string | null;
|
||||
/**
|
||||
* The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
"notPortabilityReasonCode"?: number | null;
|
||||
/**
|
||||
* The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
"numberType"?: string | null;
|
||||
/**
|
||||
* Phone number to be ported. This will be in the E164 Format.
|
||||
*/
|
||||
"phoneNumber"?: string;
|
||||
/**
|
||||
* The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed.
|
||||
*/
|
||||
"portDate"?: Date | null;
|
||||
/**
|
||||
* The SID of the Phone number. This is a unique identifier of the phone number.
|
||||
*/
|
||||
"portInPhoneNumberSid"?: string;
|
||||
/**
|
||||
* The status of the port in phone number.
|
||||
*/
|
||||
"portInPhoneNumberStatus"?: string;
|
||||
/**
|
||||
* Whether the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the `not_portability_reason_code` and `not_portability_reason` fields for more details
|
||||
*/
|
||||
"portable"?: boolean | null;
|
||||
/**
|
||||
* The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
|
||||
*/
|
||||
"rejectionReason"?: string | null;
|
||||
/**
|
||||
* The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
|
||||
*/
|
||||
"rejectionReasonCode"?: string | null;
|
||||
/**
|
||||
* Timestamp indicating when the Port In Phone Number resource was last modified.
|
||||
*/
|
||||
"statusLastTimeUpdatedTimestamp"?: string | null;
|
||||
"externalPortingVendorPhoneNumberId"?: string | null;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a PortingPortInInstance
|
||||
*/
|
||||
export interface PortingPortInListInstanceCreateOptions {
|
||||
/** */
|
||||
numbersV1PortingPortInCreate: NumbersV1PortingPortInCreate;
|
||||
}
|
||||
export interface PortingPortInContext {
|
||||
/**
|
||||
* Remove a PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a PortingPortInInstance 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 PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortInInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInInstance>) => any): Promise<ApiResponse<PortingPortInInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface PortingPortInContextSolution {
|
||||
portInRequestSid: string;
|
||||
}
|
||||
export declare class PortingPortInContextImpl implements PortingPortInContext {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortInContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, portInRequestSid: 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?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInInstance>) => any): Promise<ApiResponse<PortingPortInInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): PortingPortInContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface PortingPortInResource {
|
||||
port_in_request_sid: string;
|
||||
url: string;
|
||||
account_sid: string;
|
||||
notification_emails: Array<string>;
|
||||
target_port_in_date: Date;
|
||||
target_port_in_time_range_start: string;
|
||||
target_port_in_time_range_end: string;
|
||||
port_in_request_status: string;
|
||||
order_cancellation_reason: string;
|
||||
losing_carrier_information: NumbersV1PortingLosingCarrierInformation;
|
||||
phone_numbers: Array<NumbersV1PortingPortInPhoneNumberResult>;
|
||||
bundle_sid: string;
|
||||
portability_advance_carrier: string;
|
||||
auto_cancel_approval_numbers: string;
|
||||
documents: Array<string>;
|
||||
date_created: Date;
|
||||
support_ticket_id: number;
|
||||
signature_request_url: string;
|
||||
}
|
||||
export declare class PortingPortInInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortInContextSolution;
|
||||
protected _context?: PortingPortInContext;
|
||||
constructor(_version: V1, payload: PortingPortInResource, portInRequestSid?: string);
|
||||
/**
|
||||
* The SID of the Port In request. This is a unique identifier of the port in request.
|
||||
*/
|
||||
portInRequestSid: string;
|
||||
/**
|
||||
* The URL of this Port In request
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Account Sid or subaccount where the phone number(s) will be Ported
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* Additional emails to send a copy of the signed LOA to.
|
||||
*/
|
||||
notificationEmails: Array<string>;
|
||||
/**
|
||||
* Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. If a start and end range is provided, the date will be converted to its UTC equivalent with the ranges as reference and stored in UTC. We can\'t guarantee the exact date and time, as this depends on the losing carrier.
|
||||
*/
|
||||
targetPortInDate: Date;
|
||||
/**
|
||||
* The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00\'. We can\'t guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.
|
||||
*/
|
||||
targetPortInTimeRangeStart: string;
|
||||
/**
|
||||
* The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00\'. We can\'t guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.
|
||||
*/
|
||||
targetPortInTimeRangeEnd: string;
|
||||
/**
|
||||
* The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
|
||||
*/
|
||||
portInRequestStatus: string;
|
||||
/**
|
||||
* If the order is cancelled this field will provide further context on the cause of the cancellation.
|
||||
*/
|
||||
orderCancellationReason: string;
|
||||
losingCarrierInformation: NumbersV1PortingLosingCarrierInformation;
|
||||
phoneNumbers: Array<NumbersV1PortingPortInPhoneNumberResult>;
|
||||
/**
|
||||
* The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.
|
||||
*/
|
||||
bundleSid: string;
|
||||
/**
|
||||
* A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.
|
||||
*/
|
||||
portabilityAdvanceCarrier: string;
|
||||
/**
|
||||
* Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.
|
||||
*/
|
||||
autoCancelApprovalNumbers: string;
|
||||
/**
|
||||
* List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.
|
||||
*/
|
||||
documents: Array<string>;
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* Unique ID of the request\'s support ticket
|
||||
*/
|
||||
supportTicketId: number;
|
||||
signatureRequestUrl: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a PortingPortInInstance 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 PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortInInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInInstance>) => any): Promise<ApiResponse<PortingPortInInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
portInRequestSid: string;
|
||||
url: string;
|
||||
accountSid: string;
|
||||
notificationEmails: string[];
|
||||
targetPortInDate: Date;
|
||||
targetPortInTimeRangeStart: string;
|
||||
targetPortInTimeRangeEnd: string;
|
||||
portInRequestStatus: string;
|
||||
orderCancellationReason: string;
|
||||
losingCarrierInformation: NumbersV1PortingLosingCarrierInformation;
|
||||
phoneNumbers: NumbersV1PortingPortInPhoneNumberResult[];
|
||||
bundleSid: string;
|
||||
portabilityAdvanceCarrier: string;
|
||||
autoCancelApprovalNumbers: string;
|
||||
documents: string[];
|
||||
dateCreated: Date;
|
||||
supportTicketId: number;
|
||||
signatureRequestUrl: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface PortingPortInSolution {
|
||||
}
|
||||
export interface PortingPortInListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingPortInSolution;
|
||||
_uri: string;
|
||||
(portInRequestSid: string): PortingPortInContext;
|
||||
get(portInRequestSid: string): PortingPortInContext;
|
||||
/**
|
||||
* Create a PortingPortInInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance
|
||||
*/
|
||||
create(params: NumbersV1PortingPortInCreate, headers?: any, callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
|
||||
/**
|
||||
* Create a PortingPortInInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: NumbersV1PortingPortInCreate, headers?: any, callback?: (error: Error | null, item?: ApiResponse<PortingPortInInstance>) => any): Promise<ApiResponse<PortingPortInInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingPortInListInstance(version: V1): PortingPortInListInstance;
|
||||
export {};
|
||||
347
node_modules/twilio/lib/rest/numbers/v1/portingPortIn.js
generated
vendored
Normal file
347
node_modules/twilio/lib/rest/numbers/v1/portingPortIn.js
generated
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingPortInInstance = exports.PortingPortInContextImpl = exports.NumbersV1PortingPortInPhoneNumberResult = exports.NumbersV1PortingPortInCreatePhoneNumbers = exports.NumbersV1PortingPortInCreate = exports.NumbersV1PortingLosingCarrierInformation = exports.NumbersV1PortingAddress = void 0;
|
||||
exports.PortingPortInListInstance = PortingPortInListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class NumbersV1PortingAddress {
|
||||
constructor(payload) {
|
||||
this.street = payload["street"];
|
||||
this.street2 = payload["street_2"];
|
||||
this.city = payload["city"];
|
||||
this.state = payload["state"];
|
||||
this.zip = payload["zip"];
|
||||
this.country = payload["country"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1PortingAddress = NumbersV1PortingAddress;
|
||||
class NumbersV1PortingLosingCarrierInformation {
|
||||
constructor(payload) {
|
||||
this.customerName = payload["customer_name"];
|
||||
this.accountNumber = payload["account_number"];
|
||||
this.accountTelephoneNumber = payload["account_telephone_number"];
|
||||
this.addressSid = payload["address_sid"];
|
||||
this.address = payload["address"];
|
||||
this.authorizedRepresentative = payload["authorized_representative"];
|
||||
this.authorizedRepresentativeEmail =
|
||||
payload["authorized_representative_email"];
|
||||
this.customerType = payload["customer_type"];
|
||||
this.authorizedRepresentativeKatakana =
|
||||
payload["authorized_representative_katakana"];
|
||||
this.subMunicipality = payload["sub_municipality"];
|
||||
this.building = payload["building"];
|
||||
this.katakanaName = payload["katakana_name"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1PortingLosingCarrierInformation = NumbersV1PortingLosingCarrierInformation;
|
||||
class NumbersV1PortingPortInCreate {
|
||||
constructor(payload) {
|
||||
this.accountSid = payload["account_sid"];
|
||||
this.documents = payload["documents"];
|
||||
this.phoneNumbers = payload["phone_numbers"];
|
||||
this.losingCarrierInformation = payload["losing_carrier_information"];
|
||||
this.notificationEmails = payload["notification_emails"];
|
||||
this.targetPortInDate = payload["target_port_in_date"];
|
||||
this.targetPortInTimeRangeStart =
|
||||
payload["target_port_in_time_range_start"];
|
||||
this.targetPortInTimeRangeEnd = payload["target_port_in_time_range_end"];
|
||||
this.bundleSid = payload["bundle_sid"];
|
||||
this.portabilityAdvanceCarrier = payload["portability_advance_carrier"];
|
||||
this.autoCancelApprovalNumbers = payload["auto_cancel_approval_numbers"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1PortingPortInCreate = NumbersV1PortingPortInCreate;
|
||||
class NumbersV1PortingPortInCreatePhoneNumbers {
|
||||
constructor(payload) {
|
||||
this.phoneNumber = payload["phone_number"];
|
||||
this.pin = payload["pin"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1PortingPortInCreatePhoneNumbers = NumbersV1PortingPortInCreatePhoneNumbers;
|
||||
class NumbersV1PortingPortInPhoneNumberResult {
|
||||
constructor(payload) {
|
||||
this.notPortabilityReason = payload["not_portability_reason"];
|
||||
this.notPortabilityReasonCode = payload["not_portability_reason_code"];
|
||||
this.numberType = payload["number_type"];
|
||||
this.phoneNumber = payload["phone_number"];
|
||||
this.portDate = payload["port_date"];
|
||||
this.portInPhoneNumberSid = payload["port_in_phone_number_sid"];
|
||||
this.portInPhoneNumberStatus = payload["port_in_phone_number_status"];
|
||||
this.portable = payload["portable"];
|
||||
this.rejectionReason = payload["rejection_reason"];
|
||||
this.rejectionReasonCode = payload["rejection_reason_code"];
|
||||
this.statusLastTimeUpdatedTimestamp =
|
||||
payload["status_last_time_updated_timestamp"];
|
||||
this.externalPortingVendorPhoneNumberId =
|
||||
payload["external_porting_vendor_phone_number_id"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1PortingPortInPhoneNumberResult = NumbersV1PortingPortInPhoneNumberResult;
|
||||
class PortingPortInContextImpl {
|
||||
constructor(_version, portInRequestSid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
|
||||
throw new Error("Parameter 'portInRequestSid' is not valid.");
|
||||
}
|
||||
this._solution = { portInRequestSid };
|
||||
this._uri = `/Porting/PortIn/${portInRequestSid}`;
|
||||
}
|
||||
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 PortingPortInInstance(operationVersion, payload, instance._solution.portInRequestSid));
|
||||
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 PortingPortInInstance(operationVersion, response.body, instance._solution.portInRequestSid),
|
||||
}));
|
||||
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.PortingPortInContextImpl = PortingPortInContextImpl;
|
||||
class PortingPortInInstance {
|
||||
constructor(_version, payload, portInRequestSid) {
|
||||
this._version = _version;
|
||||
this.portInRequestSid = payload.port_in_request_sid;
|
||||
this.url = payload.url;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.notificationEmails = payload.notification_emails;
|
||||
this.targetPortInDate = deserialize.iso8601Date(payload.target_port_in_date);
|
||||
this.targetPortInTimeRangeStart = payload.target_port_in_time_range_start;
|
||||
this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end;
|
||||
this.portInRequestStatus = payload.port_in_request_status;
|
||||
this.orderCancellationReason = payload.order_cancellation_reason;
|
||||
this.losingCarrierInformation =
|
||||
payload.losing_carrier_information !== null &&
|
||||
payload.losing_carrier_information !== undefined
|
||||
? new NumbersV1PortingLosingCarrierInformation(payload.losing_carrier_information)
|
||||
: null;
|
||||
this.phoneNumbers =
|
||||
payload.phone_numbers !== null && payload.phone_numbers !== undefined
|
||||
? payload.phone_numbers.map((payload) => new NumbersV1PortingPortInPhoneNumberResult(payload))
|
||||
: null;
|
||||
this.bundleSid = payload.bundle_sid;
|
||||
this.portabilityAdvanceCarrier = payload.portability_advance_carrier;
|
||||
this.autoCancelApprovalNumbers = payload.auto_cancel_approval_numbers;
|
||||
this.documents = payload.documents;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.supportTicketId = deserialize.integer(payload.support_ticket_id);
|
||||
this.signatureRequestUrl = payload.signature_request_url;
|
||||
this._solution = {
|
||||
portInRequestSid: portInRequestSid || this.portInRequestSid,
|
||||
};
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new PortingPortInContextImpl(this._version, this._solution.portInRequestSid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a PortingPortInInstance 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 PortingPortInInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a PortingPortInInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
portInRequestSid: this.portInRequestSid,
|
||||
url: this.url,
|
||||
accountSid: this.accountSid,
|
||||
notificationEmails: this.notificationEmails,
|
||||
targetPortInDate: this.targetPortInDate,
|
||||
targetPortInTimeRangeStart: this.targetPortInTimeRangeStart,
|
||||
targetPortInTimeRangeEnd: this.targetPortInTimeRangeEnd,
|
||||
portInRequestStatus: this.portInRequestStatus,
|
||||
orderCancellationReason: this.orderCancellationReason,
|
||||
losingCarrierInformation: this.losingCarrierInformation,
|
||||
phoneNumbers: this.phoneNumbers,
|
||||
bundleSid: this.bundleSid,
|
||||
portabilityAdvanceCarrier: this.portabilityAdvanceCarrier,
|
||||
autoCancelApprovalNumbers: this.autoCancelApprovalNumbers,
|
||||
documents: this.documents,
|
||||
dateCreated: this.dateCreated,
|
||||
supportTicketId: this.supportTicketId,
|
||||
signatureRequestUrl: this.signatureRequestUrl,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingPortInInstance = PortingPortInInstance;
|
||||
function PortingPortInListInstance(version) {
|
||||
const instance = ((portInRequestSid) => instance.get(portInRequestSid));
|
||||
instance.get = function get(portInRequestSid) {
|
||||
return new PortingPortInContextImpl(version, portInRequestSid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Porting/PortIn`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new PortingPortInInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 PortingPortInInstance(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;
|
||||
}
|
||||
236
node_modules/twilio/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts
generated
vendored
Normal file
236
node_modules/twilio/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts
generated
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export interface PortingPortInPhoneNumberContext {
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance 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 PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortInPhoneNumberInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInPhoneNumberInstance>) => any): Promise<ApiResponse<PortingPortInPhoneNumberInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface PortingPortInPhoneNumberContextSolution {
|
||||
portInRequestSid: string;
|
||||
phoneNumberSid: string;
|
||||
}
|
||||
export declare class PortingPortInPhoneNumberContextImpl implements PortingPortInPhoneNumberContext {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortInPhoneNumberContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, portInRequestSid: string, phoneNumberSid: 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?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInPhoneNumberInstance>) => any): Promise<ApiResponse<PortingPortInPhoneNumberInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): PortingPortInPhoneNumberContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface PortingPortInPhoneNumberResource {
|
||||
port_in_request_sid: string;
|
||||
phone_number_sid: string;
|
||||
url: string;
|
||||
account_sid: string;
|
||||
phone_number_type: string;
|
||||
date_created: Date;
|
||||
country: string;
|
||||
missing_required_fields: boolean;
|
||||
last_updated: Date;
|
||||
phone_number: string;
|
||||
portable: boolean;
|
||||
not_portability_reason: string;
|
||||
not_portability_reason_code: number;
|
||||
port_in_phone_number_status: string;
|
||||
port_out_pin: number;
|
||||
rejection_reason: string;
|
||||
rejection_reason_code: number;
|
||||
port_date: Date;
|
||||
}
|
||||
export declare class PortingPortInPhoneNumberInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortInPhoneNumberContextSolution;
|
||||
protected _context?: PortingPortInPhoneNumberContext;
|
||||
constructor(_version: V1, payload: PortingPortInPhoneNumberResource, portInRequestSid?: string, phoneNumberSid?: string);
|
||||
/**
|
||||
* The unique identifier for the port in request that this phone number is associated with.
|
||||
*/
|
||||
portInRequestSid: string;
|
||||
/**
|
||||
* The unique identifier for this phone number associated with this port in request.
|
||||
*/
|
||||
phoneNumberSid: string;
|
||||
/**
|
||||
* URL reference for this resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Account Sid or subaccount where the phone number(s) will be Ported.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
phoneNumberType: string;
|
||||
/**
|
||||
* The timestamp for when this port in phone number was created.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The ISO country code that this number is associated with. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
country: string;
|
||||
/**
|
||||
* Indicates if the phone number is missing required fields such as a PIN or account number. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
missingRequiredFields: boolean;
|
||||
/**
|
||||
* Timestamp indicating when the Port In Phone Number resource was last modified.
|
||||
*/
|
||||
lastUpdated: Date;
|
||||
/**
|
||||
* Phone number to be ported. This will be in the E164 Format.
|
||||
*/
|
||||
phoneNumber: string;
|
||||
/**
|
||||
* If the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the `not_portability_reason_code` and `not_portability_reason` fields for more details
|
||||
*/
|
||||
portable: boolean;
|
||||
/**
|
||||
* The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
notPortabilityReason: string;
|
||||
/**
|
||||
* The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
|
||||
*/
|
||||
notPortabilityReasonCode: number;
|
||||
/**
|
||||
* The status of the port in phone number.
|
||||
*/
|
||||
portInPhoneNumberStatus: string;
|
||||
/**
|
||||
* The pin required by the losing carrier to do the port out.
|
||||
*/
|
||||
portOutPin: number;
|
||||
/**
|
||||
* The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
|
||||
*/
|
||||
rejectionReason: string;
|
||||
/**
|
||||
* The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
|
||||
*/
|
||||
rejectionReasonCode: number;
|
||||
/**
|
||||
* The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed.
|
||||
*/
|
||||
portDate: Date;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance 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 PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortInPhoneNumberInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortInPhoneNumberInstance>) => any): Promise<ApiResponse<PortingPortInPhoneNumberInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
portInRequestSid: string;
|
||||
phoneNumberSid: string;
|
||||
url: string;
|
||||
accountSid: string;
|
||||
phoneNumberType: string;
|
||||
dateCreated: Date;
|
||||
country: string;
|
||||
missingRequiredFields: boolean;
|
||||
lastUpdated: Date;
|
||||
phoneNumber: string;
|
||||
portable: boolean;
|
||||
notPortabilityReason: string;
|
||||
notPortabilityReasonCode: number;
|
||||
portInPhoneNumberStatus: string;
|
||||
portOutPin: number;
|
||||
rejectionReason: string;
|
||||
rejectionReasonCode: number;
|
||||
portDate: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface PortingPortInPhoneNumberSolution {
|
||||
}
|
||||
export interface PortingPortInPhoneNumberListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingPortInPhoneNumberSolution;
|
||||
_uri: string;
|
||||
(portInRequestSid: string, phoneNumberSid: string): PortingPortInPhoneNumberContext;
|
||||
get(portInRequestSid: string, phoneNumberSid: string): PortingPortInPhoneNumberContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingPortInPhoneNumberListInstance(version: V1): PortingPortInPhoneNumberListInstance;
|
||||
export {};
|
||||
223
node_modules/twilio/lib/rest/numbers/v1/portingPortInPhoneNumber.js
generated
vendored
Normal file
223
node_modules/twilio/lib/rest/numbers/v1/portingPortInPhoneNumber.js
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingPortInPhoneNumberInstance = exports.PortingPortInPhoneNumberContextImpl = void 0;
|
||||
exports.PortingPortInPhoneNumberListInstance = PortingPortInPhoneNumberListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class PortingPortInPhoneNumberContextImpl {
|
||||
constructor(_version, portInRequestSid, phoneNumberSid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
|
||||
throw new Error("Parameter 'portInRequestSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(phoneNumberSid)) {
|
||||
throw new Error("Parameter 'phoneNumberSid' is not valid.");
|
||||
}
|
||||
this._solution = { portInRequestSid, phoneNumberSid };
|
||||
this._uri = `/Porting/PortIn/${portInRequestSid}/PhoneNumber/${phoneNumberSid}`;
|
||||
}
|
||||
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 PortingPortInPhoneNumberInstance(operationVersion, payload, instance._solution.portInRequestSid, instance._solution.phoneNumberSid));
|
||||
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 PortingPortInPhoneNumberInstance(operationVersion, response.body, instance._solution.portInRequestSid, instance._solution.phoneNumberSid),
|
||||
}));
|
||||
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.PortingPortInPhoneNumberContextImpl = PortingPortInPhoneNumberContextImpl;
|
||||
class PortingPortInPhoneNumberInstance {
|
||||
constructor(_version, payload, portInRequestSid, phoneNumberSid) {
|
||||
this._version = _version;
|
||||
this.portInRequestSid = payload.port_in_request_sid;
|
||||
this.phoneNumberSid = payload.phone_number_sid;
|
||||
this.url = payload.url;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.phoneNumberType = payload.phone_number_type;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.country = payload.country;
|
||||
this.missingRequiredFields = payload.missing_required_fields;
|
||||
this.lastUpdated = deserialize.iso8601DateTime(payload.last_updated);
|
||||
this.phoneNumber = payload.phone_number;
|
||||
this.portable = payload.portable;
|
||||
this.notPortabilityReason = payload.not_portability_reason;
|
||||
this.notPortabilityReasonCode = deserialize.integer(payload.not_portability_reason_code);
|
||||
this.portInPhoneNumberStatus = payload.port_in_phone_number_status;
|
||||
this.portOutPin = deserialize.integer(payload.port_out_pin);
|
||||
this.rejectionReason = payload.rejection_reason;
|
||||
this.rejectionReasonCode = deserialize.integer(payload.rejection_reason_code);
|
||||
this.portDate = deserialize.iso8601DateTime(payload.port_date);
|
||||
this._solution = {
|
||||
portInRequestSid: portInRequestSid || this.portInRequestSid,
|
||||
phoneNumberSid: phoneNumberSid || this.phoneNumberSid,
|
||||
};
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new PortingPortInPhoneNumberContextImpl(this._version, this._solution.portInRequestSid, this._solution.phoneNumberSid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a PortingPortInPhoneNumberInstance 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 PortingPortInPhoneNumberInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a PortingPortInPhoneNumberInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortInPhoneNumberInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
portInRequestSid: this.portInRequestSid,
|
||||
phoneNumberSid: this.phoneNumberSid,
|
||||
url: this.url,
|
||||
accountSid: this.accountSid,
|
||||
phoneNumberType: this.phoneNumberType,
|
||||
dateCreated: this.dateCreated,
|
||||
country: this.country,
|
||||
missingRequiredFields: this.missingRequiredFields,
|
||||
lastUpdated: this.lastUpdated,
|
||||
phoneNumber: this.phoneNumber,
|
||||
portable: this.portable,
|
||||
notPortabilityReason: this.notPortabilityReason,
|
||||
notPortabilityReasonCode: this.notPortabilityReasonCode,
|
||||
portInPhoneNumberStatus: this.portInPhoneNumberStatus,
|
||||
portOutPin: this.portOutPin,
|
||||
rejectionReason: this.rejectionReason,
|
||||
rejectionReasonCode: this.rejectionReasonCode,
|
||||
portDate: this.portDate,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingPortInPhoneNumberInstance = PortingPortInPhoneNumberInstance;
|
||||
function PortingPortInPhoneNumberListInstance(version) {
|
||||
const instance = ((portInRequestSid, phoneNumberSid) => instance.get(portInRequestSid, phoneNumberSid));
|
||||
instance.get = function get(portInRequestSid, phoneNumberSid) {
|
||||
return new PortingPortInPhoneNumberContextImpl(version, portInRequestSid, phoneNumberSid);
|
||||
};
|
||||
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;
|
||||
}
|
||||
193
node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts
generated
vendored
Normal file
193
node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The type of the requested phone number. One of `LOCAL`, `UNKNOWN`, `MOBILE`, `TOLL-FREE`.
|
||||
*/
|
||||
export type PortingPortabilityNumberType = "LOCAL" | "UNKNOWN" | "MOBILE" | "TOLL-FREE";
|
||||
/**
|
||||
* Options to pass to fetch a PortingPortabilityInstance
|
||||
*/
|
||||
export interface PortingPortabilityContextFetchOptions {
|
||||
/** Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. */
|
||||
targetAccountSid?: string;
|
||||
/** Address Sid of customer to which the number will be ported. */
|
||||
addressSid?: string;
|
||||
}
|
||||
export interface PortingPortabilityContext {
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance
|
||||
*/
|
||||
fetch(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any): Promise<ApiResponse<PortingPortabilityInstance>>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any): Promise<ApiResponse<PortingPortabilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface PortingPortabilityContextSolution {
|
||||
phoneNumber: string;
|
||||
}
|
||||
export declare class PortingPortabilityContextImpl implements PortingPortabilityContext {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortabilityContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, phoneNumber: string);
|
||||
fetch(params?: PortingPortabilityContextFetchOptions | ((error: Error | null, item?: PortingPortabilityInstance) => any), callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
||||
fetchWithHttpInfo(params?: PortingPortabilityContextFetchOptions | ((error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any): Promise<ApiResponse<PortingPortabilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): PortingPortabilityContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface PortingPortabilityResource {
|
||||
phone_number: string;
|
||||
account_sid: string;
|
||||
portable: boolean;
|
||||
pin_and_account_number_required: boolean;
|
||||
not_portable_reason: string;
|
||||
not_portable_reason_code: number;
|
||||
number_type: PortingPortabilityNumberType;
|
||||
country: string;
|
||||
url: string;
|
||||
}
|
||||
export declare class PortingPortabilityInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingPortabilityContextSolution;
|
||||
protected _context?: PortingPortabilityContext;
|
||||
constructor(_version: V1, payload: PortingPortabilityResource, phoneNumber?: string);
|
||||
/**
|
||||
* The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
|
||||
*/
|
||||
phoneNumber: string;
|
||||
/**
|
||||
* Account Sid that the phone number belongs to in Twilio. This is only returned for phone numbers that already exist in Twilio’s inventory and belong to your account or sub account.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not.
|
||||
*/
|
||||
portable: boolean;
|
||||
/**
|
||||
* Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number. If this is true you will be required to submit both a PIN and account number from the losing carrier for this number when opening a port in request. These fields will be required in order to complete the port in process to Twilio.
|
||||
*/
|
||||
pinAndAccountNumberRequired: boolean;
|
||||
/**
|
||||
* Reason why the phone number cannot be ported into Twilio, `null` otherwise.
|
||||
*/
|
||||
notPortableReason: string;
|
||||
/**
|
||||
* The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise.
|
||||
*/
|
||||
notPortableReasonCode: number;
|
||||
numberType: PortingPortabilityNumberType;
|
||||
/**
|
||||
* Country the phone number belongs to.
|
||||
*/
|
||||
country: string;
|
||||
/**
|
||||
* This is the url of the request that you\'re trying to reach out to locate the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance
|
||||
*/
|
||||
fetch(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any): Promise<ApiResponse<PortingPortabilityInstance>>;
|
||||
/**
|
||||
* Fetch a PortingPortabilityInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingPortabilityInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<PortingPortabilityInstance>) => any): Promise<ApiResponse<PortingPortabilityInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
phoneNumber: string;
|
||||
accountSid: string;
|
||||
portable: boolean;
|
||||
pinAndAccountNumberRequired: boolean;
|
||||
notPortableReason: string;
|
||||
notPortableReasonCode: number;
|
||||
numberType: PortingPortabilityNumberType;
|
||||
country: string;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface PortingPortabilitySolution {
|
||||
}
|
||||
export interface PortingPortabilityListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingPortabilitySolution;
|
||||
_uri: string;
|
||||
(phoneNumber: string): PortingPortabilityContext;
|
||||
get(phoneNumber: string): PortingPortabilityContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingPortabilityListInstance(version: V1): PortingPortabilityListInstance;
|
||||
export {};
|
||||
166
node_modules/twilio/lib/rest/numbers/v1/portingPortability.js
generated
vendored
Normal file
166
node_modules/twilio/lib/rest/numbers/v1/portingPortability.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingPortabilityInstance = exports.PortingPortabilityContextImpl = void 0;
|
||||
exports.PortingPortabilityListInstance = PortingPortabilityListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class PortingPortabilityContextImpl {
|
||||
constructor(_version, phoneNumber) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(phoneNumber)) {
|
||||
throw new Error("Parameter 'phoneNumber' is not valid.");
|
||||
}
|
||||
this._solution = { phoneNumber };
|
||||
this._uri = `/Porting/Portability/PhoneNumber/${phoneNumber}`;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["targetAccountSid"] !== undefined)
|
||||
data["TargetAccountSid"] = params["targetAccountSid"];
|
||||
if (params["addressSid"] !== undefined)
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new PortingPortabilityInstance(operationVersion, payload, instance._solution.phoneNumber));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["targetAccountSid"] !== undefined)
|
||||
data["TargetAccountSid"] = params["targetAccountSid"];
|
||||
if (params["addressSid"] !== undefined)
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
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",
|
||||
params: data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new PortingPortabilityInstance(operationVersion, response.body, instance._solution.phoneNumber),
|
||||
}));
|
||||
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.PortingPortabilityContextImpl = PortingPortabilityContextImpl;
|
||||
class PortingPortabilityInstance {
|
||||
constructor(_version, payload, phoneNumber) {
|
||||
this._version = _version;
|
||||
this.phoneNumber = payload.phone_number;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.portable = payload.portable;
|
||||
this.pinAndAccountNumberRequired = payload.pin_and_account_number_required;
|
||||
this.notPortableReason = payload.not_portable_reason;
|
||||
this.notPortableReasonCode = deserialize.integer(payload.not_portable_reason_code);
|
||||
this.numberType = payload.number_type;
|
||||
this.country = payload.country;
|
||||
this.url = payload.url;
|
||||
this._solution = { phoneNumber: phoneNumber || this.phoneNumber };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new PortingPortabilityContextImpl(this._version, this._solution.phoneNumber);
|
||||
return this._context;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
return this._proxy.fetch(params, callback);
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
return this._proxy.fetchWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
phoneNumber: this.phoneNumber,
|
||||
accountSid: this.accountSid,
|
||||
portable: this.portable,
|
||||
pinAndAccountNumberRequired: this.pinAndAccountNumberRequired,
|
||||
notPortableReason: this.notPortableReason,
|
||||
notPortableReasonCode: this.notPortableReasonCode,
|
||||
numberType: this.numberType,
|
||||
country: this.country,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingPortabilityInstance = PortingPortabilityInstance;
|
||||
function PortingPortabilityListInstance(version) {
|
||||
const instance = ((phoneNumber) => instance.get(phoneNumber));
|
||||
instance.get = function get(phoneNumber) {
|
||||
return new PortingPortabilityContextImpl(version, phoneNumber);
|
||||
};
|
||||
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;
|
||||
}
|
||||
98
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts
generated
vendored
Normal file
98
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a PortingWebhookConfigurationInstance
|
||||
*/
|
||||
export interface PortingWebhookConfigurationListInstanceCreateOptions {
|
||||
/** */
|
||||
body?: object;
|
||||
}
|
||||
export interface PortingWebhookConfigurationSolution {
|
||||
}
|
||||
export interface PortingWebhookConfigurationListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingWebhookConfigurationSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a PortingWebhookConfigurationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingWebhookConfigurationInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: PortingWebhookConfigurationInstance) => any): Promise<PortingWebhookConfigurationInstance>;
|
||||
/**
|
||||
* Create a PortingWebhookConfigurationInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingWebhookConfigurationInstance
|
||||
*/
|
||||
create(params: object, headers?: any, callback?: (error: Error | null, item?: PortingWebhookConfigurationInstance) => any): Promise<PortingWebhookConfigurationInstance>;
|
||||
/**
|
||||
* Create a PortingWebhookConfigurationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingWebhookConfigurationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PortingWebhookConfigurationInstance>) => any): Promise<ApiResponse<PortingWebhookConfigurationInstance>>;
|
||||
/**
|
||||
* Create a PortingWebhookConfigurationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PortingWebhookConfigurationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: object, headers?: any, callback?: (error: Error | null, item?: ApiResponse<PortingWebhookConfigurationInstance>) => any): Promise<ApiResponse<PortingWebhookConfigurationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingWebhookConfigurationListInstance(version: V1): PortingWebhookConfigurationListInstance;
|
||||
interface PortingWebhookConfigurationResource {
|
||||
url: string;
|
||||
port_in_target_url: string;
|
||||
port_out_target_url: string;
|
||||
notifications_of: Array<string>;
|
||||
}
|
||||
export declare class PortingWebhookConfigurationInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: PortingWebhookConfigurationResource);
|
||||
/**
|
||||
* The URL of the webhook configuration request
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The complete webhook url that will be called when a notification event for port in request or port in phone number happens
|
||||
*/
|
||||
portInTargetUrl: string;
|
||||
/**
|
||||
* The complete webhook url that will be called when a notification event for a port out phone number happens.
|
||||
*/
|
||||
portOutTargetUrl: string;
|
||||
/**
|
||||
* A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.
|
||||
*/
|
||||
notificationsOf: Array<string>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
url: string;
|
||||
portInTargetUrl: string;
|
||||
portOutTargetUrl: string;
|
||||
notificationsOf: string[];
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
115
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfiguration.js
generated
vendored
Normal file
115
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingWebhookConfigurationInstance = void 0;
|
||||
exports.PortingWebhookConfigurationListInstance = PortingWebhookConfigurationListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function PortingWebhookConfigurationListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Porting/Configuration/Webhook`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new PortingWebhookConfigurationInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 PortingWebhookConfigurationInstance(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 PortingWebhookConfigurationInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.url = payload.url;
|
||||
this.portInTargetUrl = payload.port_in_target_url;
|
||||
this.portOutTargetUrl = payload.port_out_target_url;
|
||||
this.notificationsOf = payload.notifications_of;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
url: this.url,
|
||||
portInTargetUrl: this.portInTargetUrl,
|
||||
portOutTargetUrl: this.portOutTargetUrl,
|
||||
notificationsOf: this.notificationsOf,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PortingWebhookConfigurationInstance = PortingWebhookConfigurationInstance;
|
||||
63
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts
generated
vendored
Normal file
63
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The of the webhook type of the configuration to be deleted
|
||||
*/
|
||||
export type PortingWebhookConfigurationDeleteWebhookType = "PORT_IN" | "PORT_OUT";
|
||||
export interface PortingWebhookConfigurationDeleteContext {
|
||||
/**
|
||||
* Remove a PortingWebhookConfigurationDeleteInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a PortingWebhookConfigurationDeleteInstance 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 PortingWebhookConfigurationDeleteContextSolution {
|
||||
webhookType: PortingWebhookConfigurationDeleteWebhookType;
|
||||
}
|
||||
export declare class PortingWebhookConfigurationDeleteContextImpl implements PortingWebhookConfigurationDeleteContext {
|
||||
protected _version: V1;
|
||||
protected _solution: PortingWebhookConfigurationDeleteContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, webhookType: PortingWebhookConfigurationDeleteWebhookType);
|
||||
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(): PortingWebhookConfigurationDeleteContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface PortingWebhookConfigurationDeleteSolution {
|
||||
}
|
||||
export interface PortingWebhookConfigurationDeleteListInstance {
|
||||
_version: V1;
|
||||
_solution: PortingWebhookConfigurationDeleteSolution;
|
||||
_uri: string;
|
||||
(webhookType: PortingWebhookConfigurationDeleteWebhookType): PortingWebhookConfigurationDeleteContext;
|
||||
get(webhookType: PortingWebhookConfigurationDeleteWebhookType): PortingWebhookConfigurationDeleteContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PortingWebhookConfigurationDeleteListInstance(version: V1): PortingWebhookConfigurationDeleteListInstance;
|
||||
84
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js
generated
vendored
Normal file
84
node_modules/twilio/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.PortingWebhookConfigurationDeleteContextImpl = void 0;
|
||||
exports.PortingWebhookConfigurationDeleteListInstance = PortingWebhookConfigurationDeleteListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class PortingWebhookConfigurationDeleteContextImpl {
|
||||
constructor(_version, webhookType) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(webhookType)) {
|
||||
throw new Error("Parameter 'webhookType' is not valid.");
|
||||
}
|
||||
this._solution = { webhookType };
|
||||
this._uri = `/Porting/Configuration/Webhook/${webhookType}`;
|
||||
}
|
||||
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.PortingWebhookConfigurationDeleteContextImpl = PortingWebhookConfigurationDeleteContextImpl;
|
||||
function PortingWebhookConfigurationDeleteListInstance(version) {
|
||||
const instance = ((webhookType) => instance.get(webhookType));
|
||||
instance.get = function get(webhookType) {
|
||||
return new PortingWebhookConfigurationDeleteContextImpl(version, webhookType);
|
||||
};
|
||||
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;
|
||||
}
|
||||
181
node_modules/twilio/lib/rest/numbers/v1/senderIdRegistration.d.ts
generated
vendored
Normal file
181
node_modules/twilio/lib/rest/numbers/v1/senderIdRegistration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export declare class NumbersV1CreateEmbeddedRegistrationRequest {
|
||||
/**
|
||||
* The regulation for this registration.
|
||||
*/
|
||||
"regulationId": string;
|
||||
/**
|
||||
* The regulation version.
|
||||
*/
|
||||
"regulationVersion": number;
|
||||
/**
|
||||
* Human-readable name for the registration.
|
||||
*/
|
||||
"friendlyName": string;
|
||||
/**
|
||||
* Email address for registration status notifications.
|
||||
*/
|
||||
"statusNotificationEmail"?: string;
|
||||
/**
|
||||
* The URL of this resource.
|
||||
*/
|
||||
"statusCallbackUrl"?: string | null;
|
||||
/**
|
||||
* Additional comments about the registration.
|
||||
*/
|
||||
"comments"?: string;
|
||||
/**
|
||||
* Theme ID for the Compliance Embeddable UI.
|
||||
*/
|
||||
"themeSetId"?: string;
|
||||
/**
|
||||
* Registration data organized by section (alphanumericSender, business, useCase, authorizedRepresentative, officer, businessAddress).
|
||||
*/
|
||||
"data": {
|
||||
[key: string]: any;
|
||||
};
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class NumbersV1EmbeddedSession {
|
||||
/**
|
||||
* Session ID for the compliance embeddable.
|
||||
*/
|
||||
"sessionId": string;
|
||||
/**
|
||||
* Ephemeral session token for the compliance embeddable.
|
||||
*/
|
||||
"sessionToken": string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a SenderIdRegistrationInstance
|
||||
*/
|
||||
export interface SenderIdRegistrationListInstanceCreateOptions {
|
||||
/** */
|
||||
numbersV1CreateEmbeddedRegistrationRequest: NumbersV1CreateEmbeddedRegistrationRequest;
|
||||
}
|
||||
export interface SenderIdRegistrationSolution {
|
||||
}
|
||||
export interface SenderIdRegistrationListInstance {
|
||||
_version: V1;
|
||||
_solution: SenderIdRegistrationSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a SenderIdRegistrationInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SenderIdRegistrationInstance
|
||||
*/
|
||||
create(params: NumbersV1CreateEmbeddedRegistrationRequest, headers?: any, callback?: (error: Error | null, item?: SenderIdRegistrationInstance) => any): Promise<SenderIdRegistrationInstance>;
|
||||
/**
|
||||
* Create a SenderIdRegistrationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SenderIdRegistrationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: NumbersV1CreateEmbeddedRegistrationRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<SenderIdRegistrationInstance>) => any): Promise<ApiResponse<SenderIdRegistrationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SenderIdRegistrationListInstance(version: V1): SenderIdRegistrationListInstance;
|
||||
interface SenderIdRegistrationResource {
|
||||
id: string;
|
||||
regulationId: string;
|
||||
regulationVersion: number;
|
||||
friendlyName: string;
|
||||
status: string;
|
||||
statusNotificationEmail: string;
|
||||
statusCallbackUrl: string;
|
||||
comments: string;
|
||||
embeddedSession: NumbersV1EmbeddedSession;
|
||||
data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
}
|
||||
export declare class SenderIdRegistrationInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: SenderIdRegistrationResource);
|
||||
/**
|
||||
* Registration identifier (BU-prefixed).
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The regulation ID for this registration.
|
||||
*/
|
||||
regulationId: string;
|
||||
/**
|
||||
* The regulation version.
|
||||
*/
|
||||
regulationVersion: number;
|
||||
/**
|
||||
* The friendly name provided in the request.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* Registration status. Always DRAFT on creation.
|
||||
*/
|
||||
status: string;
|
||||
/**
|
||||
* Email address for status notifications.
|
||||
*/
|
||||
statusNotificationEmail: string;
|
||||
/**
|
||||
* Callback URL for status webhooks.
|
||||
*/
|
||||
statusCallbackUrl: string;
|
||||
/**
|
||||
* Additional comments.
|
||||
*/
|
||||
comments: string;
|
||||
embeddedSession: NumbersV1EmbeddedSession;
|
||||
/**
|
||||
* Registration data echoed from the request.
|
||||
*/
|
||||
data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Timestamp of creation.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* Timestamp of last update.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
id: string;
|
||||
regulationId: string;
|
||||
regulationVersion: number;
|
||||
friendlyName: string;
|
||||
status: string;
|
||||
statusNotificationEmail: string;
|
||||
statusCallbackUrl: string;
|
||||
comments: string;
|
||||
embeddedSession: NumbersV1EmbeddedSession;
|
||||
data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
146
node_modules/twilio/lib/rest/numbers/v1/senderIdRegistration.js
generated
vendored
Normal file
146
node_modules/twilio/lib/rest/numbers/v1/senderIdRegistration.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.SenderIdRegistrationInstance = exports.NumbersV1EmbeddedSession = exports.NumbersV1CreateEmbeddedRegistrationRequest = void 0;
|
||||
exports.SenderIdRegistrationListInstance = SenderIdRegistrationListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
class NumbersV1CreateEmbeddedRegistrationRequest {
|
||||
constructor(payload) {
|
||||
this.regulationId = payload["regulationId"];
|
||||
this.regulationVersion = payload["regulationVersion"];
|
||||
this.friendlyName = payload["friendlyName"];
|
||||
this.statusNotificationEmail = payload["statusNotificationEmail"];
|
||||
this.statusCallbackUrl = payload["statusCallbackUrl"];
|
||||
this.comments = payload["comments"];
|
||||
this.themeSetId = payload["themeSetId"];
|
||||
this.data = payload["data"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1CreateEmbeddedRegistrationRequest = NumbersV1CreateEmbeddedRegistrationRequest;
|
||||
class NumbersV1EmbeddedSession {
|
||||
constructor(payload) {
|
||||
this.sessionId = payload["sessionId"];
|
||||
this.sessionToken = payload["sessionToken"];
|
||||
}
|
||||
}
|
||||
exports.NumbersV1EmbeddedSession = NumbersV1EmbeddedSession;
|
||||
function SenderIdRegistrationListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/SenderIdRegistrations`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SenderIdRegistrationInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 SenderIdRegistrationInstance(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 SenderIdRegistrationInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.id = payload.id;
|
||||
this.regulationId = payload.regulationId;
|
||||
this.regulationVersion = deserialize.integer(payload.regulationVersion);
|
||||
this.friendlyName = payload.friendlyName;
|
||||
this.status = payload.status;
|
||||
this.statusNotificationEmail = payload.statusNotificationEmail;
|
||||
this.statusCallbackUrl = payload.statusCallbackUrl;
|
||||
this.comments = payload.comments;
|
||||
this.embeddedSession =
|
||||
payload.embeddedSession !== null && payload.embeddedSession !== undefined
|
||||
? new NumbersV1EmbeddedSession(payload.embeddedSession)
|
||||
: null;
|
||||
this.data = payload.data;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.dateCreated);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.dateUpdated);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
regulationId: this.regulationId,
|
||||
regulationVersion: this.regulationVersion,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
statusNotificationEmail: this.statusNotificationEmail,
|
||||
statusCallbackUrl: this.statusCallbackUrl,
|
||||
comments: this.comments,
|
||||
embeddedSession: this.embeddedSession,
|
||||
data: this.data,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SenderIdRegistrationInstance = SenderIdRegistrationInstance;
|
||||
288
node_modules/twilio/lib/rest/numbers/v1/signingRequestConfiguration.d.ts
generated
vendored
Normal file
288
node_modules/twilio/lib/rest/numbers/v1/signingRequestConfiguration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,288 @@
|
||||
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 create a SigningRequestConfigurationInstance
|
||||
*/
|
||||
export interface SigningRequestConfigurationListInstanceCreateOptions {
|
||||
/** */
|
||||
body?: object;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface SigningRequestConfigurationListInstanceEachOptions {
|
||||
/** The country ISO code to apply this configuration, this is an optional field, Example: US, MX */
|
||||
country?: string;
|
||||
/** The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting */
|
||||
product?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: SigningRequestConfigurationInstance, 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 SigningRequestConfigurationListInstanceOptions {
|
||||
/** The country ISO code to apply this configuration, this is an optional field, Example: US, MX */
|
||||
country?: string;
|
||||
/** The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting */
|
||||
product?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface SigningRequestConfigurationListInstancePageOptions {
|
||||
/** The country ISO code to apply this configuration, this is an optional field, Example: US, MX */
|
||||
country?: string;
|
||||
/** The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting */
|
||||
product?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface SigningRequestConfigurationSolution {
|
||||
}
|
||||
export interface SigningRequestConfigurationListInstance {
|
||||
_version: V1;
|
||||
_solution: SigningRequestConfigurationSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a SigningRequestConfigurationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SigningRequestConfigurationInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: SigningRequestConfigurationInstance) => any): Promise<SigningRequestConfigurationInstance>;
|
||||
/**
|
||||
* Create a SigningRequestConfigurationInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SigningRequestConfigurationInstance
|
||||
*/
|
||||
create(params: object, headers?: any, callback?: (error: Error | null, item?: SigningRequestConfigurationInstance) => any): Promise<SigningRequestConfigurationInstance>;
|
||||
/**
|
||||
* Create a SigningRequestConfigurationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SigningRequestConfigurationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SigningRequestConfigurationInstance>) => any): Promise<ApiResponse<SigningRequestConfigurationInstance>>;
|
||||
/**
|
||||
* Create a SigningRequestConfigurationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SigningRequestConfigurationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: object, headers?: any, callback?: (error: Error | null, item?: ApiResponse<SigningRequestConfigurationInstance>) => any): Promise<ApiResponse<SigningRequestConfigurationInstance>>;
|
||||
/**
|
||||
* Streams SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: SigningRequestConfigurationInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: SigningRequestConfigurationListInstanceEachOptions, callback?: (item: SigningRequestConfigurationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: SigningRequestConfigurationInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: SigningRequestConfigurationListInstanceEachOptions, callback?: (item: SigningRequestConfigurationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of SigningRequestConfigurationInstance 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: SigningRequestConfigurationPage) => any): Promise<SigningRequestConfigurationPage>;
|
||||
/**
|
||||
* Retrieve a single target page of SigningRequestConfigurationInstance 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<SigningRequestConfigurationPage>) => any): Promise<ApiResponse<SigningRequestConfigurationPage>>;
|
||||
/**
|
||||
* Lists SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: SigningRequestConfigurationInstance[]) => any): Promise<SigningRequestConfigurationInstance[]>;
|
||||
list(params: SigningRequestConfigurationListInstanceOptions, callback?: (error: Error | null, items: SigningRequestConfigurationInstance[]) => any): Promise<SigningRequestConfigurationInstance[]>;
|
||||
/**
|
||||
* Lists SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SigningRequestConfigurationInstance[]>) => any): Promise<ApiResponse<SigningRequestConfigurationInstance[]>>;
|
||||
listWithHttpInfo(params: SigningRequestConfigurationListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<SigningRequestConfigurationInstance[]>) => any): Promise<ApiResponse<SigningRequestConfigurationInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: SigningRequestConfigurationPage) => any): Promise<SigningRequestConfigurationPage>;
|
||||
page(params: SigningRequestConfigurationListInstancePageOptions, callback?: (error: Error | null, items: SigningRequestConfigurationPage) => any): Promise<SigningRequestConfigurationPage>;
|
||||
/**
|
||||
* Retrieve a single page of SigningRequestConfigurationInstance 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 { SigningRequestConfigurationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SigningRequestConfigurationPage>) => any): Promise<ApiResponse<SigningRequestConfigurationPage>>;
|
||||
pageWithHttpInfo(params: SigningRequestConfigurationListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<SigningRequestConfigurationPage>) => any): Promise<ApiResponse<SigningRequestConfigurationPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SigningRequestConfigurationListInstance(version: V1): SigningRequestConfigurationListInstance;
|
||||
interface SigningRequestConfigurationPayload extends TwilioResponsePayload {
|
||||
configurations: SigningRequestConfigurationResource[];
|
||||
}
|
||||
interface SigningRequestConfigurationResource {
|
||||
logo_sid: string;
|
||||
friendly_name: string;
|
||||
product: string;
|
||||
country: string;
|
||||
email_subject: string;
|
||||
email_message: string;
|
||||
url_redirection: string;
|
||||
url: string;
|
||||
}
|
||||
export declare class SigningRequestConfigurationInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: SigningRequestConfigurationResource);
|
||||
/**
|
||||
* The SID of the document that includes the logo that will appear in the LOA. To upload documents follow the following guide: https://www.twilio.com/docs/phone-numbers/regulatory/getting-started/create-new-bundle-public-rest-apis#supporting-document-create
|
||||
*/
|
||||
logoSid: string;
|
||||
/**
|
||||
* This is the string that you assigned as a friendly name for describing the creation of the configuration.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The product or service for which is requesting the signature.
|
||||
*/
|
||||
product: string;
|
||||
/**
|
||||
* The country ISO code to apply the configuration.
|
||||
*/
|
||||
country: string;
|
||||
/**
|
||||
* Subject of the email that the end client will receive ex: “Twilio Hosting Request”, maximum length of 255 characters.
|
||||
*/
|
||||
emailSubject: string;
|
||||
/**
|
||||
* Content of the email that the end client will receive ex: “This is a Hosting request from Twilio, please check the document and sign it”, maximum length of 5,000 characters.
|
||||
*/
|
||||
emailMessage: string;
|
||||
/**
|
||||
* Url the end client will be redirected after signing a document.
|
||||
*/
|
||||
urlRedirection: string;
|
||||
url: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
logoSid: string;
|
||||
friendlyName: string;
|
||||
product: string;
|
||||
country: string;
|
||||
emailSubject: string;
|
||||
emailMessage: string;
|
||||
urlRedirection: string;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class SigningRequestConfigurationPage extends Page<V1, SigningRequestConfigurationPayload, SigningRequestConfigurationResource, SigningRequestConfigurationInstance> {
|
||||
/**
|
||||
* Initialize the SigningRequestConfigurationPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: SigningRequestConfigurationSolution);
|
||||
/**
|
||||
* Build an instance of SigningRequestConfigurationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: SigningRequestConfigurationResource): SigningRequestConfigurationInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
245
node_modules/twilio/lib/rest/numbers/v1/signingRequestConfiguration.js
generated
vendored
Normal file
245
node_modules/twilio/lib/rest/numbers/v1/signingRequestConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.SigningRequestConfigurationPage = exports.SigningRequestConfigurationInstance = void 0;
|
||||
exports.SigningRequestConfigurationListInstance = SigningRequestConfigurationListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function SigningRequestConfigurationListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/SigningRequest/Configuration`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SigningRequestConfigurationInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 SigningRequestConfigurationInstance(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["country"] !== undefined)
|
||||
data["Country"] = params["country"];
|
||||
if (params["product"] !== undefined)
|
||||
data["Product"] = params["product"];
|
||||
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 SigningRequestConfigurationPage(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 SigningRequestConfigurationPage(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["country"] !== undefined)
|
||||
data["Country"] = params["country"];
|
||||
if (params["product"] !== undefined)
|
||||
data["Product"] = params["product"];
|
||||
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 SigningRequestConfigurationPage(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 SigningRequestConfigurationPage(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 SigningRequestConfigurationInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.logoSid = payload.logo_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.product = payload.product;
|
||||
this.country = payload.country;
|
||||
this.emailSubject = payload.email_subject;
|
||||
this.emailMessage = payload.email_message;
|
||||
this.urlRedirection = payload.url_redirection;
|
||||
this.url = payload.url;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
logoSid: this.logoSid,
|
||||
friendlyName: this.friendlyName,
|
||||
product: this.product,
|
||||
country: this.country,
|
||||
emailSubject: this.emailSubject,
|
||||
emailMessage: this.emailMessage,
|
||||
urlRedirection: this.urlRedirection,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SigningRequestConfigurationInstance = SigningRequestConfigurationInstance;
|
||||
class SigningRequestConfigurationPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the SigningRequestConfigurationPage
|
||||
*
|
||||
* @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 SigningRequestConfigurationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new SigningRequestConfigurationInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SigningRequestConfigurationPage = SigningRequestConfigurationPage;
|
||||
83
node_modules/twilio/lib/rest/numbers/v1/webhook.d.ts
generated
vendored
Normal file
83
node_modules/twilio/lib/rest/numbers/v1/webhook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export interface WebhookSolution {
|
||||
}
|
||||
export interface WebhookListInstance {
|
||||
_version: V1;
|
||||
_solution: WebhookSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Fetch a WebhookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed WebhookInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise<WebhookInstance>;
|
||||
/**
|
||||
* Fetch a WebhookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed WebhookInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<WebhookInstance>) => any): Promise<ApiResponse<WebhookInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function WebhookListInstance(version: V1): WebhookListInstance;
|
||||
interface WebhookResource {
|
||||
url: string;
|
||||
port_in_target_url: string;
|
||||
port_out_target_url: string;
|
||||
notifications_of: Array<string>;
|
||||
port_in_target_date_created: Date;
|
||||
port_out_target_date_created: Date;
|
||||
}
|
||||
export declare class WebhookInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: WebhookResource);
|
||||
/**
|
||||
* The URL of the webhook configuration request
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The complete webhook url that will be called when a notification event for port in request or port in phone number happens
|
||||
*/
|
||||
portInTargetUrl: string;
|
||||
/**
|
||||
* The complete webhook url that will be called when a notification event for a port out phone number happens.
|
||||
*/
|
||||
portOutTargetUrl: string;
|
||||
/**
|
||||
* A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.
|
||||
*/
|
||||
notificationsOf: Array<string>;
|
||||
/**
|
||||
* Creation date for the port in webhook configuration
|
||||
*/
|
||||
portInTargetDateCreated: Date;
|
||||
/**
|
||||
* Creation date for the port out webhook configuration
|
||||
*/
|
||||
portOutTargetDateCreated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
url: string;
|
||||
portInTargetUrl: string;
|
||||
portOutTargetUrl: string;
|
||||
notificationsOf: string[];
|
||||
portInTargetDateCreated: Date;
|
||||
portOutTargetDateCreated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
93
node_modules/twilio/lib/rest/numbers/v1/webhook.js
generated
vendored
Normal file
93
node_modules/twilio/lib/rest/numbers/v1/webhook.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.WebhookInstance = void 0;
|
||||
exports.WebhookListInstance = WebhookListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function WebhookListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Porting/Configuration/Webhook`;
|
||||
instance.fetch = function fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.fetchWithHttpInfo = function fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new WebhookInstance(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 WebhookInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.url = payload.url;
|
||||
this.portInTargetUrl = payload.port_in_target_url;
|
||||
this.portOutTargetUrl = payload.port_out_target_url;
|
||||
this.notificationsOf = payload.notifications_of;
|
||||
this.portInTargetDateCreated = deserialize.iso8601DateTime(payload.port_in_target_date_created);
|
||||
this.portOutTargetDateCreated = deserialize.iso8601DateTime(payload.port_out_target_date_created);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
url: this.url,
|
||||
portInTargetUrl: this.portInTargetUrl,
|
||||
portOutTargetUrl: this.portOutTargetUrl,
|
||||
notificationsOf: this.notificationsOf,
|
||||
portInTargetDateCreated: this.portInTargetDateCreated,
|
||||
portOutTargetDateCreated: this.portOutTargetDateCreated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.WebhookInstance = WebhookInstance;
|
||||
527
node_modules/twilio/lib/rest/numbers/v2/application.d.ts
generated
vendored
Normal file
527
node_modules/twilio/lib/rest/numbers/v2/application.d.ts
generated
vendored
Normal file
@@ -0,0 +1,527 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export declare class CreateShortCodeApplicationRequest {
|
||||
/**
|
||||
* The friendly name for the short code application.
|
||||
*/
|
||||
"friendlyName": string;
|
||||
/**
|
||||
* The ISO country code.
|
||||
*/
|
||||
"isoCountry": string;
|
||||
"businessInformation": CreateShortCodeApplicationRequestBusinessInformation;
|
||||
"setup": CreateShortCodeApplicationRequestSetup;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Business information associated with the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationRequestBusinessInformation {
|
||||
/**
|
||||
* The Compliance Profile SID for the customer-facing business profile.
|
||||
*/
|
||||
"customerFacingProfile": string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class CreateShortCodeApplicationRequestSetup {
|
||||
"chargesApply": boolean;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Business information associated with the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseBusinessInformation {
|
||||
"managingCompanyProfile"?: string;
|
||||
"customerFacingProfile"?: string;
|
||||
"businessWebsite"?: string;
|
||||
"einManagingCompanyProfile"?: string;
|
||||
"einCustomerFacingProfile"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Compliance keywords for the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseComplianceKeywords {
|
||||
"help"?: string;
|
||||
"stop"?: string;
|
||||
"info"?: string;
|
||||
"aide"?: string;
|
||||
"arret"?: string;
|
||||
"optOutFiltering"?: boolean;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Content examples for the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseContentExamples {
|
||||
"examples"?: Array<string>;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Setup configuration for the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseSetup {
|
||||
"requestType"?: string;
|
||||
"trafficType"?: string;
|
||||
"leaseType"?: string;
|
||||
"paymentFrequency"?: string;
|
||||
"shortCodePreference"?: string;
|
||||
"mmsEnabled"?: boolean;
|
||||
"freeToEndUser"?: boolean;
|
||||
"chargesApply"?: boolean;
|
||||
"currentProvider"?: string;
|
||||
"migratedMmsEnabled"?: boolean;
|
||||
"migratedLiveTraffic"?: boolean;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* SMS campaign details for the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseSmsCampaignDetails {
|
||||
"campaignName"?: string;
|
||||
"campaignBrandWebsite"?: string;
|
||||
"customerCareChannel"?: string;
|
||||
"customerCareValue"?: string;
|
||||
"campaignFrequency"?: Array<string>;
|
||||
"scUseCaseCategories"?: Array<string>;
|
||||
"smsTermsOfServiceUrl"?: string;
|
||||
"smsPrivacyPolicyUrl"?: string;
|
||||
"monthlyOutboundVolumeExpected"?: string;
|
||||
"monthlyInboundVolumeExpected"?: string;
|
||||
"avgMonthlyMessagesSentToEachSubscriber"?: string;
|
||||
"avgMonthlyMessagesReceivedFromSubscribers"?: string;
|
||||
"estimatedTotalSubscribers"?: string;
|
||||
"durationOfTheCampaign"?: string;
|
||||
"plannedTrafficSpikes"?: string;
|
||||
"spikeDetails"?: string;
|
||||
"expectedTrafficStartDate"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* User sign-up configuration for the application.
|
||||
*/
|
||||
export declare class CreateShortCodeApplicationResponseUserSignUp {
|
||||
"signUpOptions"?: Array<string>;
|
||||
"doubleOptInProcess"?: boolean;
|
||||
"doubleOptInMessage"?: string;
|
||||
"signUpConfirmationMessage"?: string;
|
||||
"doubleOptInResponseMessage"?: string;
|
||||
"onlineWebFormMessage"?: string;
|
||||
"keywordMessage"?: string;
|
||||
"ivrMessage"?: string;
|
||||
"otherFormMessage"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a ApplicationInstance
|
||||
*/
|
||||
export interface ApplicationListInstanceCreateOptions {
|
||||
/** */
|
||||
createShortCodeApplicationRequest: CreateShortCodeApplicationRequest;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ApplicationListInstanceEachOptions {
|
||||
/** The Account SID to filter by. */
|
||||
accountSid?: string;
|
||||
/** The ISO country to filter by. */
|
||||
isoCountry?: string;
|
||||
/** The application status to filter by. */
|
||||
status?: string;
|
||||
/** The friendly name to filter by. */
|
||||
friendlyName?: string;
|
||||
/** The application SID to filter by. */
|
||||
sid?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 50. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: ApplicationInstance, 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 ApplicationListInstanceOptions {
|
||||
/** The Account SID to filter by. */
|
||||
accountSid?: string;
|
||||
/** The ISO country to filter by. */
|
||||
isoCountry?: string;
|
||||
/** The application status to filter by. */
|
||||
status?: string;
|
||||
/** The friendly name to filter by. */
|
||||
friendlyName?: string;
|
||||
/** The application SID to filter by. */
|
||||
sid?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 50. */
|
||||
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 ApplicationListInstancePageOptions {
|
||||
/** The Account SID to filter by. */
|
||||
accountSid?: string;
|
||||
/** The ISO country to filter by. */
|
||||
isoCountry?: string;
|
||||
/** The application status to filter by. */
|
||||
status?: string;
|
||||
/** The friendly name to filter by. */
|
||||
friendlyName?: string;
|
||||
/** The application SID to filter by. */
|
||||
sid?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 50. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface ApplicationContext {
|
||||
/**
|
||||
* Fetch a ApplicationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
|
||||
/**
|
||||
* Fetch a ApplicationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApplicationInstance>) => any): Promise<ApiResponse<ApplicationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ApplicationContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class ApplicationContextImpl implements ApplicationContext {
|
||||
protected _version: V2;
|
||||
protected _solution: ApplicationContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApplicationInstance>) => any): Promise<ApiResponse<ApplicationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ApplicationContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ApplicationPayload extends TwilioResponsePayload {
|
||||
results: ApplicationResource[];
|
||||
}
|
||||
interface ApplicationResource {
|
||||
sid: string;
|
||||
application_requirements_sid: string;
|
||||
application_requirements_version: number;
|
||||
account_sid: string;
|
||||
bundle_sid: string;
|
||||
reviewer: string;
|
||||
zendesk_ticket_id: string;
|
||||
friendly_name: string;
|
||||
notification_emails: Array<string>;
|
||||
iso_country: string;
|
||||
state: string;
|
||||
setup: CreateShortCodeApplicationResponseSetup;
|
||||
business_information: CreateShortCodeApplicationResponseBusinessInformation;
|
||||
user_sign_up: CreateShortCodeApplicationResponseUserSignUp;
|
||||
compliance_keywords: CreateShortCodeApplicationResponseComplianceKeywords;
|
||||
content_examples: CreateShortCodeApplicationResponseContentExamples;
|
||||
sms_campaign_details: CreateShortCodeApplicationResponseSmsCampaignDetails;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
created_by: string;
|
||||
updated_by: string;
|
||||
}
|
||||
export declare class ApplicationInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: ApplicationContextSolution;
|
||||
protected _context?: ApplicationContext;
|
||||
constructor(_version: V2, payload: ApplicationResource, sid?: string);
|
||||
/**
|
||||
* The unique identifier of the Short Code Application.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The Application Requirements SID.
|
||||
*/
|
||||
applicationRequirementsSid: string;
|
||||
/**
|
||||
* The version of the application requirements.
|
||||
*/
|
||||
applicationRequirementsVersion: number;
|
||||
/**
|
||||
* The Account SID associated with the application.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The Bundle SID for regulatory compliance.
|
||||
*/
|
||||
bundleSid: string;
|
||||
/**
|
||||
* The reviewer of the application.
|
||||
*/
|
||||
reviewer: string;
|
||||
/**
|
||||
* The Zendesk ticket ID associated with the application.
|
||||
*/
|
||||
zendeskTicketId: string;
|
||||
/**
|
||||
* The friendly name of the application.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The notification emails for the application.
|
||||
*/
|
||||
notificationEmails: Array<string>;
|
||||
/**
|
||||
* The ISO country code.
|
||||
*/
|
||||
isoCountry: string;
|
||||
/**
|
||||
* The state of the application.
|
||||
*/
|
||||
state: string;
|
||||
setup: CreateShortCodeApplicationResponseSetup;
|
||||
businessInformation: CreateShortCodeApplicationResponseBusinessInformation;
|
||||
userSignUp: CreateShortCodeApplicationResponseUserSignUp;
|
||||
complianceKeywords: CreateShortCodeApplicationResponseComplianceKeywords;
|
||||
contentExamples: CreateShortCodeApplicationResponseContentExamples;
|
||||
smsCampaignDetails: CreateShortCodeApplicationResponseSmsCampaignDetails;
|
||||
/**
|
||||
* The date and time the application was created.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time the application was last updated.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The identity of the user who created the application.
|
||||
*/
|
||||
createdBy: string;
|
||||
/**
|
||||
* The identity of the user who last updated the application.
|
||||
*/
|
||||
updatedBy: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a ApplicationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
|
||||
/**
|
||||
* Fetch a ApplicationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApplicationInstance>) => any): Promise<ApiResponse<ApplicationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
applicationRequirementsSid: string;
|
||||
applicationRequirementsVersion: number;
|
||||
accountSid: string;
|
||||
bundleSid: string;
|
||||
reviewer: string;
|
||||
zendeskTicketId: string;
|
||||
friendlyName: string;
|
||||
notificationEmails: string[];
|
||||
isoCountry: string;
|
||||
state: string;
|
||||
setup: CreateShortCodeApplicationResponseSetup;
|
||||
businessInformation: CreateShortCodeApplicationResponseBusinessInformation;
|
||||
userSignUp: CreateShortCodeApplicationResponseUserSignUp;
|
||||
complianceKeywords: CreateShortCodeApplicationResponseComplianceKeywords;
|
||||
contentExamples: CreateShortCodeApplicationResponseContentExamples;
|
||||
smsCampaignDetails: CreateShortCodeApplicationResponseSmsCampaignDetails;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
createdBy: string;
|
||||
updatedBy: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ApplicationSolution {
|
||||
}
|
||||
export interface ApplicationListInstance {
|
||||
_version: V2;
|
||||
_solution: ApplicationSolution;
|
||||
_uri: string;
|
||||
(sid: string): ApplicationContext;
|
||||
get(sid: string): ApplicationContext;
|
||||
/**
|
||||
* Create a ApplicationInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance
|
||||
*/
|
||||
create(params: CreateShortCodeApplicationRequest, headers?: any, callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
|
||||
/**
|
||||
* Create a ApplicationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: CreateShortCodeApplicationRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<ApplicationInstance>) => any): Promise<ApiResponse<ApplicationInstance>>;
|
||||
/**
|
||||
* Streams ApplicationInstance 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 { ApplicationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ApplicationListInstanceEachOptions, callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ApplicationInstance 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 { ApplicationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ApplicationListInstanceEachOptions, callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ApplicationInstance 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: ApplicationPage) => any): Promise<ApplicationPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ApplicationInstance 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<ApplicationPage>) => any): Promise<ApiResponse<ApplicationPage>>;
|
||||
/**
|
||||
* Lists ApplicationInstance 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 { ApplicationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise<ApplicationInstance[]>;
|
||||
list(params: ApplicationListInstanceOptions, callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise<ApplicationInstance[]>;
|
||||
/**
|
||||
* Lists ApplicationInstance 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 { ApplicationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ApplicationInstance[]>) => any): Promise<ApiResponse<ApplicationInstance[]>>;
|
||||
listWithHttpInfo(params: ApplicationListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ApplicationInstance[]>) => any): Promise<ApiResponse<ApplicationInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ApplicationInstance 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 { ApplicationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ApplicationPage) => any): Promise<ApplicationPage>;
|
||||
page(params: ApplicationListInstancePageOptions, callback?: (error: Error | null, items: ApplicationPage) => any): Promise<ApplicationPage>;
|
||||
/**
|
||||
* Retrieve a single page of ApplicationInstance 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 { ApplicationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ApplicationPage>) => any): Promise<ApiResponse<ApplicationPage>>;
|
||||
pageWithHttpInfo(params: ApplicationListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ApplicationPage>) => any): Promise<ApiResponse<ApplicationPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ApplicationListInstance(version: V2): ApplicationListInstance;
|
||||
export declare class ApplicationPage extends Page<V2, ApplicationPayload, ApplicationResource, ApplicationInstance> {
|
||||
/**
|
||||
* Initialize the ApplicationPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: ApplicationSolution);
|
||||
/**
|
||||
* Build an instance of ApplicationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ApplicationResource): ApplicationInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
507
node_modules/twilio/lib/rest/numbers/v2/application.js
generated
vendored
Normal file
507
node_modules/twilio/lib/rest/numbers/v2/application.js
generated
vendored
Normal file
@@ -0,0 +1,507 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.ApplicationPage = exports.ApplicationInstance = exports.ApplicationContextImpl = exports.CreateShortCodeApplicationResponseUserSignUp = exports.CreateShortCodeApplicationResponseSmsCampaignDetails = exports.CreateShortCodeApplicationResponseSetup = exports.CreateShortCodeApplicationResponseContentExamples = exports.CreateShortCodeApplicationResponseComplianceKeywords = exports.CreateShortCodeApplicationResponseBusinessInformation = exports.CreateShortCodeApplicationRequestSetup = exports.CreateShortCodeApplicationRequestBusinessInformation = exports.CreateShortCodeApplicationRequest = void 0;
|
||||
exports.ApplicationListInstance = ApplicationListInstance;
|
||||
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 CreateShortCodeApplicationRequest {
|
||||
constructor(payload) {
|
||||
this.friendlyName = payload["friendly_name"];
|
||||
this.isoCountry = payload["iso_country"];
|
||||
this.businessInformation = payload["business_information"];
|
||||
this.setup = payload["setup"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationRequest = CreateShortCodeApplicationRequest;
|
||||
/**
|
||||
* Business information associated with the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationRequestBusinessInformation {
|
||||
constructor(payload) {
|
||||
this.customerFacingProfile = payload["customer_facing_profile"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationRequestBusinessInformation = CreateShortCodeApplicationRequestBusinessInformation;
|
||||
class CreateShortCodeApplicationRequestSetup {
|
||||
constructor(payload) {
|
||||
this.chargesApply = payload["charges_apply"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationRequestSetup = CreateShortCodeApplicationRequestSetup;
|
||||
/**
|
||||
* Business information associated with the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseBusinessInformation {
|
||||
constructor(payload) {
|
||||
this.managingCompanyProfile = payload["managing_company_profile"];
|
||||
this.customerFacingProfile = payload["customer_facing_profile"];
|
||||
this.businessWebsite = payload["business_website"];
|
||||
this.einManagingCompanyProfile = payload["ein_managing_company_profile"];
|
||||
this.einCustomerFacingProfile = payload["ein_customer_facing_profile"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseBusinessInformation = CreateShortCodeApplicationResponseBusinessInformation;
|
||||
/**
|
||||
* Compliance keywords for the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseComplianceKeywords {
|
||||
constructor(payload) {
|
||||
this.help = payload["help"];
|
||||
this.stop = payload["stop"];
|
||||
this.info = payload["info"];
|
||||
this.aide = payload["aide"];
|
||||
this.arret = payload["arret"];
|
||||
this.optOutFiltering = payload["opt_out_filtering"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseComplianceKeywords = CreateShortCodeApplicationResponseComplianceKeywords;
|
||||
/**
|
||||
* Content examples for the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseContentExamples {
|
||||
constructor(payload) {
|
||||
this.examples = payload["examples"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseContentExamples = CreateShortCodeApplicationResponseContentExamples;
|
||||
/**
|
||||
* Setup configuration for the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseSetup {
|
||||
constructor(payload) {
|
||||
this.requestType = payload["request_type"];
|
||||
this.trafficType = payload["traffic_type"];
|
||||
this.leaseType = payload["lease_type"];
|
||||
this.paymentFrequency = payload["payment_frequency"];
|
||||
this.shortCodePreference = payload["short_code_preference"];
|
||||
this.mmsEnabled = payload["mms_enabled"];
|
||||
this.freeToEndUser = payload["free_to_end_user"];
|
||||
this.chargesApply = payload["charges_apply"];
|
||||
this.currentProvider = payload["current_provider"];
|
||||
this.migratedMmsEnabled = payload["migrated_mms_enabled"];
|
||||
this.migratedLiveTraffic = payload["migrated_live_traffic"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseSetup = CreateShortCodeApplicationResponseSetup;
|
||||
/**
|
||||
* SMS campaign details for the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseSmsCampaignDetails {
|
||||
constructor(payload) {
|
||||
this.campaignName = payload["campaign_name"];
|
||||
this.campaignBrandWebsite = payload["campaign_brand_website"];
|
||||
this.customerCareChannel = payload["customer_care_channel"];
|
||||
this.customerCareValue = payload["customer_care_value"];
|
||||
this.campaignFrequency = payload["campaign_frequency"];
|
||||
this.scUseCaseCategories = payload["sc_use_case_categories"];
|
||||
this.smsTermsOfServiceUrl = payload["sms_terms_of_service_url"];
|
||||
this.smsPrivacyPolicyUrl = payload["sms_privacy_policy_url"];
|
||||
this.monthlyOutboundVolumeExpected =
|
||||
payload["monthly_outbound_volume_expected"];
|
||||
this.monthlyInboundVolumeExpected =
|
||||
payload["monthly_inbound_volume_expected"];
|
||||
this.avgMonthlyMessagesSentToEachSubscriber =
|
||||
payload["avg_monthly_messages_sent_to_each_subscriber"];
|
||||
this.avgMonthlyMessagesReceivedFromSubscribers =
|
||||
payload["avg_monthly_messages_received_from_subscribers"];
|
||||
this.estimatedTotalSubscribers = payload["estimated_total_subscribers"];
|
||||
this.durationOfTheCampaign = payload["duration_of_the_campaign"];
|
||||
this.plannedTrafficSpikes = payload["planned_traffic_spikes"];
|
||||
this.spikeDetails = payload["spike_details"];
|
||||
this.expectedTrafficStartDate = payload["expected_traffic_start_date"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseSmsCampaignDetails = CreateShortCodeApplicationResponseSmsCampaignDetails;
|
||||
/**
|
||||
* User sign-up configuration for the application.
|
||||
*/
|
||||
class CreateShortCodeApplicationResponseUserSignUp {
|
||||
constructor(payload) {
|
||||
this.signUpOptions = payload["sign_up_options"];
|
||||
this.doubleOptInProcess = payload["double_opt_in_process"];
|
||||
this.doubleOptInMessage = payload["double_opt_in_message"];
|
||||
this.signUpConfirmationMessage = payload["sign_up_confirmation_message"];
|
||||
this.doubleOptInResponseMessage = payload["double_opt_in_response_message"];
|
||||
this.onlineWebFormMessage = payload["online_web_form_message"];
|
||||
this.keywordMessage = payload["keyword_message"];
|
||||
this.ivrMessage = payload["ivr_message"];
|
||||
this.otherFormMessage = payload["other_form_message"];
|
||||
}
|
||||
}
|
||||
exports.CreateShortCodeApplicationResponseUserSignUp = CreateShortCodeApplicationResponseUserSignUp;
|
||||
class ApplicationContextImpl {
|
||||
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 = `/ShortCodes/Applications/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ApplicationInstance(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 ApplicationInstance(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.ApplicationContextImpl = ApplicationContextImpl;
|
||||
class ApplicationInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.applicationRequirementsSid = payload.application_requirements_sid;
|
||||
this.applicationRequirementsVersion = deserialize.integer(payload.application_requirements_version);
|
||||
this.accountSid = payload.account_sid;
|
||||
this.bundleSid = payload.bundle_sid;
|
||||
this.reviewer = payload.reviewer;
|
||||
this.zendeskTicketId = payload.zendesk_ticket_id;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.notificationEmails = payload.notification_emails;
|
||||
this.isoCountry = payload.iso_country;
|
||||
this.state = payload.state;
|
||||
this.setup =
|
||||
payload.setup !== null && payload.setup !== undefined
|
||||
? new CreateShortCodeApplicationResponseSetup(payload.setup)
|
||||
: null;
|
||||
this.businessInformation =
|
||||
payload.business_information !== null &&
|
||||
payload.business_information !== undefined
|
||||
? new CreateShortCodeApplicationResponseBusinessInformation(payload.business_information)
|
||||
: null;
|
||||
this.userSignUp =
|
||||
payload.user_sign_up !== null && payload.user_sign_up !== undefined
|
||||
? new CreateShortCodeApplicationResponseUserSignUp(payload.user_sign_up)
|
||||
: null;
|
||||
this.complianceKeywords =
|
||||
payload.compliance_keywords !== null &&
|
||||
payload.compliance_keywords !== undefined
|
||||
? new CreateShortCodeApplicationResponseComplianceKeywords(payload.compliance_keywords)
|
||||
: null;
|
||||
this.contentExamples =
|
||||
payload.content_examples !== null &&
|
||||
payload.content_examples !== undefined
|
||||
? new CreateShortCodeApplicationResponseContentExamples(payload.content_examples)
|
||||
: null;
|
||||
this.smsCampaignDetails =
|
||||
payload.sms_campaign_details !== null &&
|
||||
payload.sms_campaign_details !== undefined
|
||||
? new CreateShortCodeApplicationResponseSmsCampaignDetails(payload.sms_campaign_details)
|
||||
: null;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.createdBy = payload.created_by;
|
||||
this.updatedBy = payload.updated_by;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ApplicationContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a ApplicationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ApplicationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApplicationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
applicationRequirementsSid: this.applicationRequirementsSid,
|
||||
applicationRequirementsVersion: this.applicationRequirementsVersion,
|
||||
accountSid: this.accountSid,
|
||||
bundleSid: this.bundleSid,
|
||||
reviewer: this.reviewer,
|
||||
zendeskTicketId: this.zendeskTicketId,
|
||||
friendlyName: this.friendlyName,
|
||||
notificationEmails: this.notificationEmails,
|
||||
isoCountry: this.isoCountry,
|
||||
state: this.state,
|
||||
setup: this.setup,
|
||||
businessInformation: this.businessInformation,
|
||||
userSignUp: this.userSignUp,
|
||||
complianceKeywords: this.complianceKeywords,
|
||||
contentExamples: this.contentExamples,
|
||||
smsCampaignDetails: this.smsCampaignDetails,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
createdBy: this.createdBy,
|
||||
updatedBy: this.updatedBy,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ApplicationInstance = ApplicationInstance;
|
||||
function ApplicationListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ApplicationContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/ShortCodes/Applications`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ApplicationInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 ApplicationInstance(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["accountSid"] !== undefined)
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["sid"] !== undefined)
|
||||
data["Sid"] = params["sid"];
|
||||
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 ApplicationPage(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 ApplicationPage(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["accountSid"] !== undefined)
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["sid"] !== undefined)
|
||||
data["Sid"] = params["sid"];
|
||||
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 ApplicationPage(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 ApplicationPage(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 ApplicationPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ApplicationPage
|
||||
*
|
||||
* @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 ApplicationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ApplicationInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ApplicationPage = ApplicationPage;
|
||||
388
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts
generated
vendored
Normal file
388
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts
generated
vendored
Normal file
@@ -0,0 +1,388 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
import { DependentHostedNumberOrderListInstance } from "./authorizationDocument/dependentHostedNumberOrder";
|
||||
/**
|
||||
* Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses.
|
||||
*/
|
||||
export type AuthorizationDocumentStatus = "opened" | "signing" | "signed" | "canceled" | "failed";
|
||||
/**
|
||||
* Options to pass to create a AuthorizationDocumentInstance
|
||||
*/
|
||||
export interface AuthorizationDocumentListInstanceCreateOptions {
|
||||
/** A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. */
|
||||
addressSid: string;
|
||||
/** Email that this AuthorizationDocument will be sent to for signing. */
|
||||
email: string;
|
||||
/** The contact phone number of the person authorized to sign the Authorization Document. */
|
||||
contactPhoneNumber: string;
|
||||
/** A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio\\\'s platform. */
|
||||
hostedNumberOrderSids: Array<string>;
|
||||
/** The title of the person authorized to sign the Authorization Document for this phone number. */
|
||||
contactTitle?: string;
|
||||
/** Email recipients who will be informed when an Authorization Document has been sent and signed. */
|
||||
ccEmails?: Array<string>;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface AuthorizationDocumentListInstanceEachOptions {
|
||||
/** Email that this AuthorizationDocument will be sent to for signing. */
|
||||
email?: string;
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: AuthorizationDocumentStatus;
|
||||
/** 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: AuthorizationDocumentInstance, 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 AuthorizationDocumentListInstanceOptions {
|
||||
/** Email that this AuthorizationDocument will be sent to for signing. */
|
||||
email?: string;
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: AuthorizationDocumentStatus;
|
||||
/** 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 AuthorizationDocumentListInstancePageOptions {
|
||||
/** Email that this AuthorizationDocument will be sent to for signing. */
|
||||
email?: string;
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: AuthorizationDocumentStatus;
|
||||
/** 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 AuthorizationDocumentContext {
|
||||
dependentHostedNumberOrders: DependentHostedNumberOrderListInstance;
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance 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 AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizationDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizationDocumentInstance>) => any): Promise<ApiResponse<AuthorizationDocumentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface AuthorizationDocumentContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class AuthorizationDocumentContextImpl implements AuthorizationDocumentContext {
|
||||
protected _version: V2;
|
||||
protected _solution: AuthorizationDocumentContextSolution;
|
||||
protected _uri: string;
|
||||
protected _dependentHostedNumberOrders?: DependentHostedNumberOrderListInstance;
|
||||
constructor(_version: V2, sid: string);
|
||||
get dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance;
|
||||
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?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizationDocumentInstance>) => any): Promise<ApiResponse<AuthorizationDocumentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): AuthorizationDocumentContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface AuthorizationDocumentPayload extends TwilioResponsePayload {
|
||||
items: AuthorizationDocumentResource[];
|
||||
}
|
||||
interface AuthorizationDocumentResource {
|
||||
sid: string;
|
||||
address_sid: string;
|
||||
status: AuthorizationDocumentStatus;
|
||||
email: string;
|
||||
cc_emails: Array<string>;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class AuthorizationDocumentInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: AuthorizationDocumentContextSolution;
|
||||
protected _context?: AuthorizationDocumentContext;
|
||||
constructor(_version: V2, payload: AuthorizationDocumentResource, sid?: string);
|
||||
/**
|
||||
* A 34 character string that uniquely identifies this AuthorizationDocument.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
|
||||
*/
|
||||
addressSid: string;
|
||||
status: AuthorizationDocumentStatus;
|
||||
/**
|
||||
* Email that this AuthorizationDocument will be sent to for signing.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* Email recipients who will be informed when an Authorization Document has been sent and signed.
|
||||
*/
|
||||
ccEmails: Array<string>;
|
||||
/**
|
||||
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance 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 AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizationDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizationDocumentInstance>) => any): Promise<ApiResponse<AuthorizationDocumentInstance>>;
|
||||
/**
|
||||
* Access the dependentHostedNumberOrders.
|
||||
*/
|
||||
dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
addressSid: string;
|
||||
status: AuthorizationDocumentStatus;
|
||||
email: string;
|
||||
ccEmails: string[];
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface AuthorizationDocumentSolution {
|
||||
}
|
||||
export interface AuthorizationDocumentListInstance {
|
||||
_version: V2;
|
||||
_solution: AuthorizationDocumentSolution;
|
||||
_uri: string;
|
||||
(sid: string): AuthorizationDocumentContext;
|
||||
get(sid: string): AuthorizationDocumentContext;
|
||||
/**
|
||||
* Create a AuthorizationDocumentInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance
|
||||
*/
|
||||
create(params: AuthorizationDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
||||
/**
|
||||
* Create a AuthorizationDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: AuthorizationDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<AuthorizationDocumentInstance>) => any): Promise<ApiResponse<AuthorizationDocumentInstance>>;
|
||||
/**
|
||||
* Streams AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: AuthorizationDocumentListInstanceEachOptions, callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: AuthorizationDocumentListInstanceEachOptions, callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of AuthorizationDocumentInstance 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: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
||||
/**
|
||||
* Retrieve a single target page of AuthorizationDocumentInstance 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<AuthorizationDocumentPage>) => any): Promise<ApiResponse<AuthorizationDocumentPage>>;
|
||||
/**
|
||||
* Lists AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise<AuthorizationDocumentInstance[]>;
|
||||
list(params: AuthorizationDocumentListInstanceOptions, callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise<AuthorizationDocumentInstance[]>;
|
||||
/**
|
||||
* Lists AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<AuthorizationDocumentInstance[]>) => any): Promise<ApiResponse<AuthorizationDocumentInstance[]>>;
|
||||
listWithHttpInfo(params: AuthorizationDocumentListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<AuthorizationDocumentInstance[]>) => any): Promise<ApiResponse<AuthorizationDocumentInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
||||
page(params: AuthorizationDocumentListInstancePageOptions, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
||||
/**
|
||||
* Retrieve a single page of AuthorizationDocumentInstance 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 { AuthorizationDocumentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<AuthorizationDocumentPage>) => any): Promise<ApiResponse<AuthorizationDocumentPage>>;
|
||||
pageWithHttpInfo(params: AuthorizationDocumentListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<AuthorizationDocumentPage>) => any): Promise<ApiResponse<AuthorizationDocumentPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function AuthorizationDocumentListInstance(version: V2): AuthorizationDocumentListInstance;
|
||||
export declare class AuthorizationDocumentPage extends Page<V2, AuthorizationDocumentPayload, AuthorizationDocumentResource, AuthorizationDocumentInstance> {
|
||||
/**
|
||||
* Initialize the AuthorizationDocumentPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: AuthorizationDocumentSolution);
|
||||
/**
|
||||
* Build an instance of AuthorizationDocumentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: AuthorizationDocumentResource): AuthorizationDocumentInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
420
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js
generated
vendored
Normal file
420
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js
generated
vendored
Normal file
@@ -0,0 +1,420 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.AuthorizationDocumentPage = exports.AuthorizationDocumentInstance = exports.AuthorizationDocumentContextImpl = void 0;
|
||||
exports.AuthorizationDocumentListInstance = AuthorizationDocumentListInstance;
|
||||
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 dependentHostedNumberOrder_1 = require("./authorizationDocument/dependentHostedNumberOrder");
|
||||
class AuthorizationDocumentContextImpl {
|
||||
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 = `/HostedNumber/AuthorizationDocuments/${sid}`;
|
||||
}
|
||||
get dependentHostedNumberOrders() {
|
||||
this._dependentHostedNumberOrders =
|
||||
this._dependentHostedNumberOrders ||
|
||||
(0, dependentHostedNumberOrder_1.DependentHostedNumberOrderListInstance)(this._version, this._solution.sid);
|
||||
return this._dependentHostedNumberOrders;
|
||||
}
|
||||
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 AuthorizationDocumentInstance(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 AuthorizationDocumentInstance(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.AuthorizationDocumentContextImpl = AuthorizationDocumentContextImpl;
|
||||
class AuthorizationDocumentInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.addressSid = payload.address_sid;
|
||||
this.status = payload.status;
|
||||
this.email = payload.email;
|
||||
this.ccEmails = payload.cc_emails;
|
||||
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 AuthorizationDocumentContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a AuthorizationDocumentInstance 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 AuthorizationDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a AuthorizationDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizationDocumentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Access the dependentHostedNumberOrders.
|
||||
*/
|
||||
dependentHostedNumberOrders() {
|
||||
return this._proxy.dependentHostedNumberOrders;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
addressSid: this.addressSid,
|
||||
status: this.status,
|
||||
email: this.email,
|
||||
ccEmails: this.ccEmails,
|
||||
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.AuthorizationDocumentInstance = AuthorizationDocumentInstance;
|
||||
function AuthorizationDocumentListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new AuthorizationDocumentContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumber/AuthorizationDocuments`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["addressSid"] === null || params["addressSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['addressSid']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
if (params["contactPhoneNumber"] === null ||
|
||||
params["contactPhoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['contactPhoneNumber']\" missing.");
|
||||
}
|
||||
if (params["hostedNumberOrderSids"] === null ||
|
||||
params["hostedNumberOrderSids"] === undefined) {
|
||||
throw new Error("Required parameter \"params['hostedNumberOrderSids']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
data["Email"] = params["email"];
|
||||
data["ContactPhoneNumber"] = params["contactPhoneNumber"];
|
||||
data["HostedNumberOrderSids"] = serialize.map(params["hostedNumberOrderSids"], (e) => e);
|
||||
if (params["contactTitle"] !== undefined)
|
||||
data["ContactTitle"] = params["contactTitle"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
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 AuthorizationDocumentInstance(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["addressSid"] === null || params["addressSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['addressSid']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
if (params["contactPhoneNumber"] === null ||
|
||||
params["contactPhoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['contactPhoneNumber']\" missing.");
|
||||
}
|
||||
if (params["hostedNumberOrderSids"] === null ||
|
||||
params["hostedNumberOrderSids"] === undefined) {
|
||||
throw new Error("Required parameter \"params['hostedNumberOrderSids']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
data["Email"] = params["email"];
|
||||
data["ContactPhoneNumber"] = params["contactPhoneNumber"];
|
||||
data["HostedNumberOrderSids"] = serialize.map(params["hostedNumberOrderSids"], (e) => e);
|
||||
if (params["contactTitle"] !== undefined)
|
||||
data["ContactTitle"] = params["contactTitle"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
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 AuthorizationDocumentInstance(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["email"] !== undefined)
|
||||
data["Email"] = params["email"];
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
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 AuthorizationDocumentPage(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 AuthorizationDocumentPage(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["email"] !== undefined)
|
||||
data["Email"] = params["email"];
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
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 AuthorizationDocumentPage(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 AuthorizationDocumentPage(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 AuthorizationDocumentPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the AuthorizationDocumentPage
|
||||
*
|
||||
* @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 AuthorizationDocumentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new AuthorizationDocumentInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.AuthorizationDocumentPage = AuthorizationDocumentPage;
|
||||
320
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts
generated
vendored
Normal file
320
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
import { PhoneNumberCapabilities } from "../../../../interfaces";
|
||||
/**
|
||||
* Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses.
|
||||
*/
|
||||
export type DependentHostedNumberOrderStatus = "received" | "verified" | "pending-loa" | "carrier-processing" | "completed" | "failed" | "action-required";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface DependentHostedNumberOrderListInstanceEachOptions {
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: DependentHostedNumberOrderStatus;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: DependentHostedNumberOrderInstance, 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 DependentHostedNumberOrderListInstanceOptions {
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: DependentHostedNumberOrderStatus;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface DependentHostedNumberOrderListInstancePageOptions {
|
||||
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */
|
||||
status?: DependentHostedNumberOrderStatus;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface DependentHostedNumberOrderSolution {
|
||||
signingDocumentSid: string;
|
||||
}
|
||||
export interface DependentHostedNumberOrderListInstance {
|
||||
_version: V2;
|
||||
_solution: DependentHostedNumberOrderSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Streams DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: DependentHostedNumberOrderListInstanceEachOptions, callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: DependentHostedNumberOrderListInstanceEachOptions, callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of DependentHostedNumberOrderInstance 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: DependentHostedNumberOrderPage) => any): Promise<DependentHostedNumberOrderPage>;
|
||||
/**
|
||||
* Retrieve a single target page of DependentHostedNumberOrderInstance 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<DependentHostedNumberOrderPage>) => any): Promise<ApiResponse<DependentHostedNumberOrderPage>>;
|
||||
/**
|
||||
* Lists DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise<DependentHostedNumberOrderInstance[]>;
|
||||
list(params: DependentHostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise<DependentHostedNumberOrderInstance[]>;
|
||||
/**
|
||||
* Lists DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<DependentHostedNumberOrderInstance[]>) => any): Promise<ApiResponse<DependentHostedNumberOrderInstance[]>>;
|
||||
listWithHttpInfo(params: DependentHostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<DependentHostedNumberOrderInstance[]>) => any): Promise<ApiResponse<DependentHostedNumberOrderInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise<DependentHostedNumberOrderPage>;
|
||||
page(params: DependentHostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise<DependentHostedNumberOrderPage>;
|
||||
/**
|
||||
* Retrieve a single page of DependentHostedNumberOrderInstance 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 { DependentHostedNumberOrderListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<DependentHostedNumberOrderPage>) => any): Promise<ApiResponse<DependentHostedNumberOrderPage>>;
|
||||
pageWithHttpInfo(params: DependentHostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<DependentHostedNumberOrderPage>) => any): Promise<ApiResponse<DependentHostedNumberOrderPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function DependentHostedNumberOrderListInstance(version: V2, signingDocumentSid: string): DependentHostedNumberOrderListInstance;
|
||||
interface DependentHostedNumberOrderPayload extends TwilioResponsePayload {
|
||||
items: DependentHostedNumberOrderResource[];
|
||||
}
|
||||
interface DependentHostedNumberOrderResource {
|
||||
sid: string;
|
||||
bulk_hosting_request_sid: string;
|
||||
next_step: string;
|
||||
account_sid: string;
|
||||
incoming_phone_number_sid: string;
|
||||
address_sid: string;
|
||||
signing_document_sid: string;
|
||||
phone_number: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendly_name: string;
|
||||
status: DependentHostedNumberOrderStatus;
|
||||
failure_reason: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
email: string;
|
||||
cc_emails: Array<string>;
|
||||
contact_title: string;
|
||||
contact_phone_number: string;
|
||||
}
|
||||
export declare class DependentHostedNumberOrderInstance {
|
||||
protected _version: V2;
|
||||
constructor(_version: V2, payload: DependentHostedNumberOrderResource, signingDocumentSid: string);
|
||||
/**
|
||||
* A 34 character string that uniquely identifies this Authorization Document
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder.
|
||||
*/
|
||||
bulkHostingRequestSid: string;
|
||||
/**
|
||||
* The next step you need to take to complete the hosted number order and request it successfully.
|
||||
*/
|
||||
nextStep: string;
|
||||
/**
|
||||
* The unique SID identifier of the Account.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.
|
||||
*/
|
||||
incomingPhoneNumberSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
|
||||
*/
|
||||
addressSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the LOA document associated with this HostedNumberOrder.
|
||||
*/
|
||||
signingDocumentSid: string;
|
||||
/**
|
||||
* An E164 formatted phone number hosted by this HostedNumberOrder.
|
||||
*/
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
/**
|
||||
* A human readable description of this resource, up to 128 characters.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: DependentHostedNumberOrderStatus;
|
||||
/**
|
||||
* A message that explains why a hosted_number_order went to status \"action-required\"
|
||||
*/
|
||||
failureReason: string;
|
||||
/**
|
||||
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Email of the owner of this phone number that is being hosted.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* Email recipients who will be informed when an Authorization Document has been sent and signed
|
||||
*/
|
||||
ccEmails: Array<string>;
|
||||
/**
|
||||
* The title of the person authorized to sign the Authorization Document for this phone number.
|
||||
*/
|
||||
contactTitle: string;
|
||||
/**
|
||||
* The contact phone number of the person authorized to sign the Authorization Document.
|
||||
*/
|
||||
contactPhoneNumber: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
bulkHostingRequestSid: string;
|
||||
nextStep: string;
|
||||
accountSid: string;
|
||||
incomingPhoneNumberSid: string;
|
||||
addressSid: string;
|
||||
signingDocumentSid: string;
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendlyName: string;
|
||||
status: DependentHostedNumberOrderStatus;
|
||||
failureReason: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
email: string;
|
||||
ccEmails: string[];
|
||||
contactTitle: string;
|
||||
contactPhoneNumber: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class DependentHostedNumberOrderPage extends Page<V2, DependentHostedNumberOrderPayload, DependentHostedNumberOrderResource, DependentHostedNumberOrderInstance> {
|
||||
/**
|
||||
* Initialize the DependentHostedNumberOrderPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: DependentHostedNumberOrderSolution);
|
||||
/**
|
||||
* Build an instance of DependentHostedNumberOrderInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: DependentHostedNumberOrderResource): DependentHostedNumberOrderInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
221
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js
generated
vendored
Normal file
221
node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js
generated
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.DependentHostedNumberOrderPage = exports.DependentHostedNumberOrderInstance = void 0;
|
||||
exports.DependentHostedNumberOrderListInstance = DependentHostedNumberOrderListInstance;
|
||||
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 DependentHostedNumberOrderListInstance(version, signingDocumentSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(signingDocumentSid)) {
|
||||
throw new Error("Parameter 'signingDocumentSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { signingDocumentSid };
|
||||
instance._uri = `/HostedNumber/AuthorizationDocuments/${signingDocumentSid}/DependentHostedNumberOrders`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["phoneNumber"] !== undefined)
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
if (params["incomingPhoneNumberSid"] !== undefined)
|
||||
data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new DependentHostedNumberOrderPage(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 DependentHostedNumberOrderPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["phoneNumber"] !== undefined)
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
if (params["incomingPhoneNumberSid"] !== undefined)
|
||||
data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new DependentHostedNumberOrderPage(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 DependentHostedNumberOrderPage(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 DependentHostedNumberOrderInstance {
|
||||
constructor(_version, payload, signingDocumentSid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.bulkHostingRequestSid = payload.bulk_hosting_request_sid;
|
||||
this.nextStep = payload.next_step;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.incomingPhoneNumberSid = payload.incoming_phone_number_sid;
|
||||
this.addressSid = payload.address_sid;
|
||||
this.signingDocumentSid = payload.signing_document_sid;
|
||||
this.phoneNumber = payload.phone_number;
|
||||
this.capabilities = payload.capabilities;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.failureReason = payload.failure_reason;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.email = payload.email;
|
||||
this.ccEmails = payload.cc_emails;
|
||||
this.contactTitle = payload.contact_title;
|
||||
this.contactPhoneNumber = payload.contact_phone_number;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
bulkHostingRequestSid: this.bulkHostingRequestSid,
|
||||
nextStep: this.nextStep,
|
||||
accountSid: this.accountSid,
|
||||
incomingPhoneNumberSid: this.incomingPhoneNumberSid,
|
||||
addressSid: this.addressSid,
|
||||
signingDocumentSid: this.signingDocumentSid,
|
||||
phoneNumber: this.phoneNumber,
|
||||
capabilities: this.capabilities,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
failureReason: this.failureReason,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
email: this.email,
|
||||
ccEmails: this.ccEmails,
|
||||
contactTitle: this.contactTitle,
|
||||
contactPhoneNumber: this.contactPhoneNumber,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.DependentHostedNumberOrderInstance = DependentHostedNumberOrderInstance;
|
||||
class DependentHostedNumberOrderPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the DependentHostedNumberOrderPage
|
||||
*
|
||||
* @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 DependentHostedNumberOrderInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new DependentHostedNumberOrderInstance(this._version, payload, this._solution.signingDocumentSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.DependentHostedNumberOrderPage = DependentHostedNumberOrderPage;
|
||||
234
node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts
generated
vendored
Normal file
234
node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* A string that shows the status of the current Bulk Hosting request, it can vary between these values: \'QUEUED\',\'IN_PROGRESS\',\'PROCESSED\'
|
||||
*/
|
||||
export type BulkHostedNumberOrderRequestStatus = "QUEUED" | "IN_PROGRESS" | "PROCESSED";
|
||||
/**
|
||||
* Options to pass to fetch a BulkHostedNumberOrderInstance
|
||||
*/
|
||||
export interface BulkHostedNumberOrderContextFetchOptions {
|
||||
/** Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check \'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values\'. */
|
||||
orderStatus?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a BulkHostedNumberOrderInstance
|
||||
*/
|
||||
export interface BulkHostedNumberOrderListInstanceCreateOptions {
|
||||
/** */
|
||||
body?: object;
|
||||
}
|
||||
export interface BulkHostedNumberOrderContext {
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
fetch(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface BulkHostedNumberOrderContextSolution {
|
||||
bulkHostingSid: string;
|
||||
}
|
||||
export declare class BulkHostedNumberOrderContextImpl implements BulkHostedNumberOrderContext {
|
||||
protected _version: V2;
|
||||
protected _solution: BulkHostedNumberOrderContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, bulkHostingSid: string);
|
||||
fetch(params?: BulkHostedNumberOrderContextFetchOptions | ((error: Error | null, item?: BulkHostedNumberOrderInstance) => any), callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
fetchWithHttpInfo(params?: BulkHostedNumberOrderContextFetchOptions | ((error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): BulkHostedNumberOrderContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface BulkHostedNumberOrderResource {
|
||||
bulk_hosting_sid: string;
|
||||
request_status: BulkHostedNumberOrderRequestStatus;
|
||||
friendly_name: string;
|
||||
notification_email: string;
|
||||
date_created: Date;
|
||||
date_completed: Date;
|
||||
url: string;
|
||||
total_count: number;
|
||||
results: Array<any>;
|
||||
}
|
||||
export declare class BulkHostedNumberOrderInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: BulkHostedNumberOrderContextSolution;
|
||||
protected _context?: BulkHostedNumberOrderContext;
|
||||
constructor(_version: V2, payload: BulkHostedNumberOrderResource, bulkHostingSid?: string);
|
||||
/**
|
||||
* A 34 character string that uniquely identifies this BulkHostedNumberOrder.
|
||||
*/
|
||||
bulkHostingSid: string;
|
||||
requestStatus: BulkHostedNumberOrderRequestStatus;
|
||||
/**
|
||||
* A 128 character string that is a human-readable text that describes this resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* Email address used for send notifications about this Bulk hosted number request.
|
||||
*/
|
||||
notificationEmail: string;
|
||||
/**
|
||||
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date that this resource was completed, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCompleted: Date;
|
||||
/**
|
||||
* The URL of this BulkHostedNumberOrder resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The total count of phone numbers in this Bulk hosting request.
|
||||
*/
|
||||
totalCount: number;
|
||||
/**
|
||||
* Contains a list of all the individual hosting orders and their information, for this Bulk request. Each result object is grouped by its order status. To see a complete list of order status, please check \'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values\'.
|
||||
*/
|
||||
results: Array<any>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
fetch(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Fetch a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
bulkHostingSid: string;
|
||||
requestStatus: BulkHostedNumberOrderRequestStatus;
|
||||
friendlyName: string;
|
||||
notificationEmail: string;
|
||||
dateCreated: Date;
|
||||
dateCompleted: Date;
|
||||
url: string;
|
||||
totalCount: number;
|
||||
results: any[];
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface BulkHostedNumberOrderSolution {
|
||||
}
|
||||
export interface BulkHostedNumberOrderListInstance {
|
||||
_version: V2;
|
||||
_solution: BulkHostedNumberOrderSolution;
|
||||
_uri: string;
|
||||
(bulkHostingSid: string): BulkHostedNumberOrderContext;
|
||||
get(bulkHostingSid: string): BulkHostedNumberOrderContext;
|
||||
/**
|
||||
* Create a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Create a BulkHostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance
|
||||
*/
|
||||
create(params: object, headers?: any, callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise<BulkHostedNumberOrderInstance>;
|
||||
/**
|
||||
* Create a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Create a BulkHostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkHostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: object, headers?: any, callback?: (error: Error | null, item?: ApiResponse<BulkHostedNumberOrderInstance>) => any): Promise<ApiResponse<BulkHostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BulkHostedNumberOrderListInstance(version: V2): BulkHostedNumberOrderListInstance;
|
||||
export {};
|
||||
218
node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js
generated
vendored
Normal file
218
node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.BulkHostedNumberOrderInstance = exports.BulkHostedNumberOrderContextImpl = void 0;
|
||||
exports.BulkHostedNumberOrderListInstance = BulkHostedNumberOrderListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class BulkHostedNumberOrderContextImpl {
|
||||
constructor(_version, bulkHostingSid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(bulkHostingSid)) {
|
||||
throw new Error("Parameter 'bulkHostingSid' is not valid.");
|
||||
}
|
||||
this._solution = { bulkHostingSid };
|
||||
this._uri = `/HostedNumber/Orders/Bulk/${bulkHostingSid}`;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["orderStatus"] !== undefined)
|
||||
data["OrderStatus"] = params["orderStatus"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new BulkHostedNumberOrderInstance(operationVersion, payload, instance._solution.bulkHostingSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["orderStatus"] !== undefined)
|
||||
data["OrderStatus"] = params["orderStatus"];
|
||||
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",
|
||||
params: data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new BulkHostedNumberOrderInstance(operationVersion, response.body, instance._solution.bulkHostingSid),
|
||||
}));
|
||||
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.BulkHostedNumberOrderContextImpl = BulkHostedNumberOrderContextImpl;
|
||||
class BulkHostedNumberOrderInstance {
|
||||
constructor(_version, payload, bulkHostingSid) {
|
||||
this._version = _version;
|
||||
this.bulkHostingSid = payload.bulk_hosting_sid;
|
||||
this.requestStatus = payload.request_status;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.notificationEmail = payload.notification_email;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed);
|
||||
this.url = payload.url;
|
||||
this.totalCount = deserialize.integer(payload.total_count);
|
||||
this.results = payload.results;
|
||||
this._solution = { bulkHostingSid: bulkHostingSid || this.bulkHostingSid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new BulkHostedNumberOrderContextImpl(this._version, this._solution.bulkHostingSid);
|
||||
return this._context;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
return this._proxy.fetch(params, callback);
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
return this._proxy.fetchWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
bulkHostingSid: this.bulkHostingSid,
|
||||
requestStatus: this.requestStatus,
|
||||
friendlyName: this.friendlyName,
|
||||
notificationEmail: this.notificationEmail,
|
||||
dateCreated: this.dateCreated,
|
||||
dateCompleted: this.dateCompleted,
|
||||
url: this.url,
|
||||
totalCount: this.totalCount,
|
||||
results: this.results,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BulkHostedNumberOrderInstance = BulkHostedNumberOrderInstance;
|
||||
function BulkHostedNumberOrderListInstance(version) {
|
||||
const instance = ((bulkHostingSid) => instance.get(bulkHostingSid));
|
||||
instance.get = function get(bulkHostingSid) {
|
||||
return new BulkHostedNumberOrderContextImpl(version, bulkHostingSid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumber/Orders/Bulk`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new BulkHostedNumberOrderInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
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 BulkHostedNumberOrderInstance(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;
|
||||
}
|
||||
175
node_modules/twilio/lib/rest/numbers/v2/bundleClone.d.ts
generated
vendored
Normal file
175
node_modules/twilio/lib/rest/numbers/v2/bundleClone.d.ts
generated
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The verification status of the Bundle resource.
|
||||
*/
|
||||
export type BundleCloneStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved";
|
||||
/**
|
||||
* Options to pass to create a BundleCloneInstance
|
||||
*/
|
||||
export interface BundleCloneContextCreateOptions {
|
||||
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. */
|
||||
targetAccountSid: string;
|
||||
/** If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved */
|
||||
moveToDraft?: boolean;
|
||||
/** The string that you assigned to describe the cloned bundle. */
|
||||
friendlyName?: string;
|
||||
}
|
||||
export interface BundleCloneContext {
|
||||
/**
|
||||
* Create a BundleCloneInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCloneInstance
|
||||
*/
|
||||
create(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: BundleCloneInstance) => any): Promise<BundleCloneInstance>;
|
||||
/**
|
||||
* Create a BundleCloneInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCloneInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleCloneInstance>) => any): Promise<ApiResponse<BundleCloneInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface BundleCloneContextSolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export declare class BundleCloneContextImpl implements BundleCloneContext {
|
||||
protected _version: V2;
|
||||
protected _solution: BundleCloneContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, bundleSid: string);
|
||||
create(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: BundleCloneInstance) => any): Promise<BundleCloneInstance>;
|
||||
createWithHttpInfo(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleCloneInstance>) => any): Promise<ApiResponse<BundleCloneInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): BundleCloneContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface BundleCloneResource {
|
||||
bundle_sid: string;
|
||||
account_sid: string;
|
||||
regulation_sid: string;
|
||||
friendly_name: string;
|
||||
status: BundleCloneStatus;
|
||||
valid_until: Date;
|
||||
email: string;
|
||||
status_callback: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class BundleCloneInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: BundleCloneContextSolution;
|
||||
protected _context?: BundleCloneContext;
|
||||
constructor(_version: V2, payload: BundleCloneResource, bundleSid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
bundleSid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string of a regulation that is associated to the Bundle resource.
|
||||
*/
|
||||
regulationSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: BundleCloneStatus;
|
||||
/**
|
||||
* The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until.
|
||||
*/
|
||||
validUntil: Date;
|
||||
/**
|
||||
* The email address that will receive updates when the Bundle resource changes status.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* The URL we call to inform your application of status changes.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The URL of this resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Create a BundleCloneInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCloneInstance
|
||||
*/
|
||||
create(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: BundleCloneInstance) => any): Promise<BundleCloneInstance>;
|
||||
/**
|
||||
* Create a BundleCloneInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCloneInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: BundleCloneContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleCloneInstance>) => any): Promise<ApiResponse<BundleCloneInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
bundleSid: string;
|
||||
accountSid: string;
|
||||
regulationSid: string;
|
||||
friendlyName: string;
|
||||
status: BundleCloneStatus;
|
||||
validUntil: Date;
|
||||
email: string;
|
||||
statusCallback: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface BundleCloneSolution {
|
||||
}
|
||||
export interface BundleCloneListInstance {
|
||||
_version: V2;
|
||||
_solution: BundleCloneSolution;
|
||||
_uri: string;
|
||||
(bundleSid: string): BundleCloneContext;
|
||||
get(bundleSid: string): BundleCloneContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BundleCloneListInstance(version: V2): BundleCloneListInstance;
|
||||
export {};
|
||||
174
node_modules/twilio/lib/rest/numbers/v2/bundleClone.js
generated
vendored
Normal file
174
node_modules/twilio/lib/rest/numbers/v2/bundleClone.js
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.BundleCloneInstance = exports.BundleCloneContextImpl = void 0;
|
||||
exports.BundleCloneListInstance = BundleCloneListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class BundleCloneContextImpl {
|
||||
constructor(_version, bundleSid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
this._solution = { bundleSid };
|
||||
this._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Clones`;
|
||||
}
|
||||
create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["targetAccountSid"] === null ||
|
||||
params["targetAccountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['targetAccountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["TargetAccountSid"] = params["targetAccountSid"];
|
||||
if (params["moveToDraft"] !== undefined)
|
||||
data["MoveToDraft"] = serialize.bool(params["moveToDraft"]);
|
||||
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.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new BundleCloneInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["targetAccountSid"] === null ||
|
||||
params["targetAccountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['targetAccountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["TargetAccountSid"] = params["targetAccountSid"];
|
||||
if (params["moveToDraft"] !== undefined)
|
||||
data["MoveToDraft"] = serialize.bool(params["moveToDraft"]);
|
||||
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
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new BundleCloneInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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.BundleCloneContextImpl = BundleCloneContextImpl;
|
||||
class BundleCloneInstance {
|
||||
constructor(_version, payload, bundleSid) {
|
||||
this._version = _version;
|
||||
this.bundleSid = payload.bundle_sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.regulationSid = payload.regulation_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.validUntil = deserialize.iso8601DateTime(payload.valid_until);
|
||||
this.email = payload.email;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this._solution = { bundleSid: bundleSid || this.bundleSid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new BundleCloneContextImpl(this._version, this._solution.bundleSid);
|
||||
return this._context;
|
||||
}
|
||||
create(params, callback) {
|
||||
return this._proxy.create(params, callback);
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
return this._proxy.createWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
bundleSid: this.bundleSid,
|
||||
accountSid: this.accountSid,
|
||||
regulationSid: this.regulationSid,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
validUntil: this.validUntil,
|
||||
email: this.email,
|
||||
statusCallback: this.statusCallback,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BundleCloneInstance = BundleCloneInstance;
|
||||
function BundleCloneListInstance(version) {
|
||||
const instance = ((bundleSid) => instance.get(bundleSid));
|
||||
instance.get = function get(bundleSid) {
|
||||
return new BundleCloneContextImpl(version, bundleSid);
|
||||
};
|
||||
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;
|
||||
}
|
||||
568
node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts
generated
vendored
Normal file
568
node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,568 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
import { PhoneNumberCapabilities } from "../../../interfaces";
|
||||
/**
|
||||
* Status of this resource. It can hold one of the values: 1. Twilio Processing 2. Received, 3. Pending LOA, 4. Carrier Processing, 5. Completed, 6. Action Required, 7. Failed. See the [HostedNumberOrders Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values) section for more information on each of these statuses.
|
||||
*/
|
||||
export type HostedNumberOrderStatus = "twilio-processing" | "received" | "pending-verification" | "verified" | "pending-loa" | "carrier-processing" | "testing" | "completed" | "failed" | "action-required";
|
||||
/**
|
||||
* The method used to verify ownership of the number to be hosted. Can be: `phone-call` or `phone-bill` and the default is `phone-call`.
|
||||
*/
|
||||
export type HostedNumberOrderVerificationType = "phone-call";
|
||||
/**
|
||||
* Options to pass to update a HostedNumberOrderInstance
|
||||
*/
|
||||
export interface HostedNumberOrderContextUpdateOptions {
|
||||
/** */
|
||||
status: HostedNumberOrderStatus;
|
||||
/** The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. */
|
||||
verificationCallDelay?: number;
|
||||
/** The numerical extension to dial when making the ownership verification call. */
|
||||
verificationCallExtension?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a HostedNumberOrderInstance
|
||||
*/
|
||||
export interface HostedNumberOrderListInstanceCreateOptions {
|
||||
/** The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format */
|
||||
phoneNumber: string;
|
||||
/** The contact phone number of the person authorized to sign the Authorization Document. */
|
||||
contactPhoneNumber: string;
|
||||
/** Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. */
|
||||
addressSid: string;
|
||||
/** Optional. Email of the owner of this phone number that is being hosted. */
|
||||
email: string;
|
||||
/** This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. */
|
||||
accountSid?: string;
|
||||
/** A 128 character string that is a human readable text that describes this resource. */
|
||||
friendlyName?: string;
|
||||
/** Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. */
|
||||
ccEmails?: Array<string>;
|
||||
/** The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsUrl?: string;
|
||||
/** The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsMethod?: string;
|
||||
/** A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsFallbackUrl?: string;
|
||||
/** Used to specify that the SMS capability will be hosted on Twilio\\\'s platform. */
|
||||
smsCapability?: boolean;
|
||||
/** The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsFallbackMethod?: string;
|
||||
/** Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. */
|
||||
statusCallbackUrl?: string;
|
||||
/** Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. */
|
||||
smsApplicationSid?: string;
|
||||
/** The title of the person authorized to sign the Authorization Document for this phone number. */
|
||||
contactTitle?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface HostedNumberOrderListInstanceEachOptions {
|
||||
/** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */
|
||||
status?: HostedNumberOrderStatus;
|
||||
/** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */
|
||||
smsCapability?: boolean;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: HostedNumberOrderInstance, 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 HostedNumberOrderListInstanceOptions {
|
||||
/** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */
|
||||
status?: HostedNumberOrderStatus;
|
||||
/** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */
|
||||
smsCapability?: boolean;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface HostedNumberOrderListInstancePageOptions {
|
||||
/** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */
|
||||
status?: HostedNumberOrderStatus;
|
||||
/** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */
|
||||
smsCapability?: boolean;
|
||||
/** An E164 formatted phone number hosted by this HostedNumberOrder. */
|
||||
phoneNumber?: string;
|
||||
/** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */
|
||||
incomingPhoneNumberSid?: string;
|
||||
/** A human readable description of this resource, up to 128 characters. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface HostedNumberOrderContext {
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance 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 HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Update a HostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
update(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Update a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface HostedNumberOrderContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class HostedNumberOrderContextImpl implements HostedNumberOrderContext {
|
||||
protected _version: V2;
|
||||
protected _solution: HostedNumberOrderContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, 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?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
update(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
updateWithHttpInfo(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): HostedNumberOrderContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface HostedNumberOrderPayload extends TwilioResponsePayload {
|
||||
items: HostedNumberOrderResource[];
|
||||
}
|
||||
interface HostedNumberOrderResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
incoming_phone_number_sid: string;
|
||||
address_sid: string;
|
||||
signing_document_sid: string;
|
||||
phone_number: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendly_name: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
failure_reason: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
email: string;
|
||||
cc_emails: Array<string>;
|
||||
url: string;
|
||||
contact_title: string;
|
||||
contact_phone_number: string;
|
||||
bulk_hosting_request_sid: string;
|
||||
next_step: string;
|
||||
verification_attempts: number;
|
||||
verification_call_sids: Array<string>;
|
||||
verification_call_delay: number;
|
||||
verification_call_extension: string;
|
||||
verification_code: string;
|
||||
verification_type: HostedNumberOrderVerificationType;
|
||||
}
|
||||
export declare class HostedNumberOrderInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: HostedNumberOrderContextSolution;
|
||||
protected _context?: HostedNumberOrderContext;
|
||||
constructor(_version: V2, payload: HostedNumberOrderResource, sid?: string);
|
||||
/**
|
||||
* A 34 character string that uniquely identifies this HostedNumberOrder.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the account.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted.
|
||||
*/
|
||||
incomingPhoneNumberSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
|
||||
*/
|
||||
addressSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign.
|
||||
*/
|
||||
signingDocumentSid: string;
|
||||
/**
|
||||
* Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212
|
||||
*/
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
/**
|
||||
* A 128 character string that is a human-readable text that describes this resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
/**
|
||||
* A message that explains why a hosted_number_order went to status \"action-required\"
|
||||
*/
|
||||
failureReason: string;
|
||||
/**
|
||||
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Email of the owner of this phone number that is being hosted.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.
|
||||
*/
|
||||
ccEmails: Array<string>;
|
||||
/**
|
||||
* The URL of this HostedNumberOrder.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The title of the person authorized to sign the Authorization Document for this phone number.
|
||||
*/
|
||||
contactTitle: string;
|
||||
/**
|
||||
* The contact phone number of the person authorized to sign the Authorization Document.
|
||||
*/
|
||||
contactPhoneNumber: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder.
|
||||
*/
|
||||
bulkHostingRequestSid: string;
|
||||
/**
|
||||
* The next step you need to take to complete the hosted number order and request it successfully.
|
||||
*/
|
||||
nextStep: string;
|
||||
/**
|
||||
* The number of attempts made to verify ownership via a call for the hosted phone number.
|
||||
*/
|
||||
verificationAttempts: number;
|
||||
/**
|
||||
* The Call SIDs that identify the calls placed to verify ownership.
|
||||
*/
|
||||
verificationCallSids: Array<string>;
|
||||
/**
|
||||
* The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
|
||||
*/
|
||||
verificationCallDelay: number;
|
||||
/**
|
||||
* The numerical extension to dial when making the ownership verification call.
|
||||
*/
|
||||
verificationCallExtension: string;
|
||||
/**
|
||||
* The digits the user must pass in the ownership verification call.
|
||||
*/
|
||||
verificationCode: string;
|
||||
verificationType: HostedNumberOrderVerificationType;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance 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 HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Fetch a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Update a HostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
update(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Update a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
incomingPhoneNumberSid: string;
|
||||
addressSid: string;
|
||||
signingDocumentSid: string;
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendlyName: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
failureReason: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
email: string;
|
||||
ccEmails: string[];
|
||||
url: string;
|
||||
contactTitle: string;
|
||||
contactPhoneNumber: string;
|
||||
bulkHostingRequestSid: string;
|
||||
nextStep: string;
|
||||
verificationAttempts: number;
|
||||
verificationCallSids: string[];
|
||||
verificationCallDelay: number;
|
||||
verificationCallExtension: string;
|
||||
verificationCode: string;
|
||||
verificationType: "phone-call";
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface HostedNumberOrderSolution {
|
||||
}
|
||||
export interface HostedNumberOrderListInstance {
|
||||
_version: V2;
|
||||
_solution: HostedNumberOrderSolution;
|
||||
_uri: string;
|
||||
(sid: string): HostedNumberOrderContext;
|
||||
get(sid: string): HostedNumberOrderContext;
|
||||
/**
|
||||
* Create a HostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
create(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Create a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Streams HostedNumberOrderInstance 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 { HostedNumberOrderListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: HostedNumberOrderListInstanceEachOptions, callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams HostedNumberOrderInstance 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 { HostedNumberOrderListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: HostedNumberOrderListInstanceEachOptions, callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of HostedNumberOrderInstance 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: HostedNumberOrderPage) => any): Promise<HostedNumberOrderPage>;
|
||||
/**
|
||||
* Retrieve a single target page of HostedNumberOrderInstance 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<HostedNumberOrderPage>) => any): Promise<ApiResponse<HostedNumberOrderPage>>;
|
||||
/**
|
||||
* Lists HostedNumberOrderInstance 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 { HostedNumberOrderListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise<HostedNumberOrderInstance[]>;
|
||||
list(params: HostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise<HostedNumberOrderInstance[]>;
|
||||
/**
|
||||
* Lists HostedNumberOrderInstance 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 { HostedNumberOrderListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<HostedNumberOrderInstance[]>) => any): Promise<ApiResponse<HostedNumberOrderInstance[]>>;
|
||||
listWithHttpInfo(params: HostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<HostedNumberOrderInstance[]>) => any): Promise<ApiResponse<HostedNumberOrderInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of HostedNumberOrderInstance 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 { HostedNumberOrderListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise<HostedNumberOrderPage>;
|
||||
page(params: HostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise<HostedNumberOrderPage>;
|
||||
/**
|
||||
* Retrieve a single page of HostedNumberOrderInstance 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 { HostedNumberOrderListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<HostedNumberOrderPage>) => any): Promise<ApiResponse<HostedNumberOrderPage>>;
|
||||
pageWithHttpInfo(params: HostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<HostedNumberOrderPage>) => any): Promise<ApiResponse<HostedNumberOrderPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function HostedNumberOrderListInstance(version: V2): HostedNumberOrderListInstance;
|
||||
export declare class HostedNumberOrderPage extends Page<V2, HostedNumberOrderPayload, HostedNumberOrderResource, HostedNumberOrderInstance> {
|
||||
/**
|
||||
* Initialize the HostedNumberOrderPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: HostedNumberOrderSolution);
|
||||
/**
|
||||
* Build an instance of HostedNumberOrderInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: HostedNumberOrderResource): HostedNumberOrderInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
555
node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js
generated
vendored
Normal file
555
node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js
generated
vendored
Normal file
@@ -0,0 +1,555 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.HostedNumberOrderPage = exports.HostedNumberOrderInstance = exports.HostedNumberOrderContextImpl = void 0;
|
||||
exports.HostedNumberOrderListInstance = HostedNumberOrderListInstance;
|
||||
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 HostedNumberOrderContextImpl {
|
||||
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 = `/HostedNumber/Orders/${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 HostedNumberOrderInstance(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 HostedNumberOrderInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["status"] === null || params["status"] === undefined) {
|
||||
throw new Error("Required parameter \"params['status']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Status"] = params["status"];
|
||||
if (params["verificationCallDelay"] !== undefined)
|
||||
data["VerificationCallDelay"] = params["verificationCallDelay"];
|
||||
if (params["verificationCallExtension"] !== undefined)
|
||||
data["VerificationCallExtension"] = params["verificationCallExtension"];
|
||||
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 HostedNumberOrderInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["status"] === null || params["status"] === undefined) {
|
||||
throw new Error("Required parameter \"params['status']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Status"] = params["status"];
|
||||
if (params["verificationCallDelay"] !== undefined)
|
||||
data["VerificationCallDelay"] = params["verificationCallDelay"];
|
||||
if (params["verificationCallExtension"] !== undefined)
|
||||
data["VerificationCallExtension"] = params["verificationCallExtension"];
|
||||
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 HostedNumberOrderInstance(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.HostedNumberOrderContextImpl = HostedNumberOrderContextImpl;
|
||||
class HostedNumberOrderInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.incomingPhoneNumberSid = payload.incoming_phone_number_sid;
|
||||
this.addressSid = payload.address_sid;
|
||||
this.signingDocumentSid = payload.signing_document_sid;
|
||||
this.phoneNumber = payload.phone_number;
|
||||
this.capabilities = payload.capabilities;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.failureReason = payload.failure_reason;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.email = payload.email;
|
||||
this.ccEmails = payload.cc_emails;
|
||||
this.url = payload.url;
|
||||
this.contactTitle = payload.contact_title;
|
||||
this.contactPhoneNumber = payload.contact_phone_number;
|
||||
this.bulkHostingRequestSid = payload.bulk_hosting_request_sid;
|
||||
this.nextStep = payload.next_step;
|
||||
this.verificationAttempts = deserialize.integer(payload.verification_attempts);
|
||||
this.verificationCallSids = payload.verification_call_sids;
|
||||
this.verificationCallDelay = deserialize.integer(payload.verification_call_delay);
|
||||
this.verificationCallExtension = payload.verification_call_extension;
|
||||
this.verificationCode = payload.verification_code;
|
||||
this.verificationType = payload.verification_type;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new HostedNumberOrderContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a HostedNumberOrderInstance 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 HostedNumberOrderInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance 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,
|
||||
accountSid: this.accountSid,
|
||||
incomingPhoneNumberSid: this.incomingPhoneNumberSid,
|
||||
addressSid: this.addressSid,
|
||||
signingDocumentSid: this.signingDocumentSid,
|
||||
phoneNumber: this.phoneNumber,
|
||||
capabilities: this.capabilities,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
failureReason: this.failureReason,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
email: this.email,
|
||||
ccEmails: this.ccEmails,
|
||||
url: this.url,
|
||||
contactTitle: this.contactTitle,
|
||||
contactPhoneNumber: this.contactPhoneNumber,
|
||||
bulkHostingRequestSid: this.bulkHostingRequestSid,
|
||||
nextStep: this.nextStep,
|
||||
verificationAttempts: this.verificationAttempts,
|
||||
verificationCallSids: this.verificationCallSids,
|
||||
verificationCallDelay: this.verificationCallDelay,
|
||||
verificationCallExtension: this.verificationCallExtension,
|
||||
verificationCode: this.verificationCode,
|
||||
verificationType: this.verificationType,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.HostedNumberOrderInstance = HostedNumberOrderInstance;
|
||||
function HostedNumberOrderListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new HostedNumberOrderContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumber/Orders`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['phoneNumber']\" missing.");
|
||||
}
|
||||
if (params["contactPhoneNumber"] === null ||
|
||||
params["contactPhoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['contactPhoneNumber']\" missing.");
|
||||
}
|
||||
if (params["addressSid"] === null || params["addressSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['addressSid']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
data["ContactPhoneNumber"] = params["contactPhoneNumber"];
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
data["Email"] = params["email"];
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
if (params["smsUrl"] !== undefined)
|
||||
data["SmsUrl"] = params["smsUrl"];
|
||||
if (params["smsMethod"] !== undefined)
|
||||
data["SmsMethod"] = params["smsMethod"];
|
||||
if (params["smsFallbackUrl"] !== undefined)
|
||||
data["SmsFallbackUrl"] = params["smsFallbackUrl"];
|
||||
if (params["smsCapability"] !== undefined)
|
||||
data["SmsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["smsFallbackMethod"] !== undefined)
|
||||
data["SmsFallbackMethod"] = params["smsFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["smsApplicationSid"] !== undefined)
|
||||
data["SmsApplicationSid"] = params["smsApplicationSid"];
|
||||
if (params["contactTitle"] !== undefined)
|
||||
data["ContactTitle"] = params["contactTitle"];
|
||||
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 HostedNumberOrderInstance(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["phoneNumber"] === null || params["phoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['phoneNumber']\" missing.");
|
||||
}
|
||||
if (params["contactPhoneNumber"] === null ||
|
||||
params["contactPhoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['contactPhoneNumber']\" missing.");
|
||||
}
|
||||
if (params["addressSid"] === null || params["addressSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['addressSid']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
data["ContactPhoneNumber"] = params["contactPhoneNumber"];
|
||||
data["AddressSid"] = params["addressSid"];
|
||||
data["Email"] = params["email"];
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
if (params["smsUrl"] !== undefined)
|
||||
data["SmsUrl"] = params["smsUrl"];
|
||||
if (params["smsMethod"] !== undefined)
|
||||
data["SmsMethod"] = params["smsMethod"];
|
||||
if (params["smsFallbackUrl"] !== undefined)
|
||||
data["SmsFallbackUrl"] = params["smsFallbackUrl"];
|
||||
if (params["smsCapability"] !== undefined)
|
||||
data["SmsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["smsFallbackMethod"] !== undefined)
|
||||
data["SmsFallbackMethod"] = params["smsFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["smsApplicationSid"] !== undefined)
|
||||
data["SmsApplicationSid"] = params["smsApplicationSid"];
|
||||
if (params["contactTitle"] !== undefined)
|
||||
data["ContactTitle"] = params["contactTitle"];
|
||||
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 HostedNumberOrderInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["smsCapability"] !== undefined)
|
||||
data["SmsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["phoneNumber"] !== undefined)
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
if (params["incomingPhoneNumberSid"] !== undefined)
|
||||
data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new HostedNumberOrderPage(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 HostedNumberOrderPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["smsCapability"] !== undefined)
|
||||
data["SmsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["phoneNumber"] !== undefined)
|
||||
data["PhoneNumber"] = params["phoneNumber"];
|
||||
if (params["incomingPhoneNumberSid"] !== undefined)
|
||||
data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new HostedNumberOrderPage(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 HostedNumberOrderPage(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 HostedNumberOrderPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the HostedNumberOrderPage
|
||||
*
|
||||
* @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 HostedNumberOrderInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new HostedNumberOrderInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.HostedNumberOrderPage = HostedNumberOrderPage;
|
||||
37
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts
generated
vendored
Normal file
37
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../V2";
|
||||
import { BundleListInstance } from "./regulatoryCompliance/bundle";
|
||||
import { EndUserListInstance } from "./regulatoryCompliance/endUser";
|
||||
import { EndUserTypeListInstance } from "./regulatoryCompliance/endUserType";
|
||||
import { RegulationListInstance } from "./regulatoryCompliance/regulation";
|
||||
import { SupportingDocumentListInstance } from "./regulatoryCompliance/supportingDocument";
|
||||
import { SupportingDocumentTypeListInstance } from "./regulatoryCompliance/supportingDocumentType";
|
||||
/**
|
||||
* The type of End User the regulation requires - can be `individual` or `business`.
|
||||
*/
|
||||
export type RegulatoryComplianceEndUserType = "individual" | "business";
|
||||
export interface RegulatoryComplianceSolution {
|
||||
}
|
||||
export interface RegulatoryComplianceListInstance {
|
||||
_version: V2;
|
||||
_solution: RegulatoryComplianceSolution;
|
||||
_uri: string;
|
||||
_bundles?: BundleListInstance;
|
||||
bundles: BundleListInstance;
|
||||
_endUsers?: EndUserListInstance;
|
||||
endUsers: EndUserListInstance;
|
||||
_endUserTypes?: EndUserTypeListInstance;
|
||||
endUserTypes: EndUserTypeListInstance;
|
||||
_regulations?: RegulationListInstance;
|
||||
regulations: RegulationListInstance;
|
||||
_supportingDocuments?: SupportingDocumentListInstance;
|
||||
supportingDocuments: SupportingDocumentListInstance;
|
||||
_supportingDocumentTypes?: SupportingDocumentTypeListInstance;
|
||||
supportingDocumentTypes: SupportingDocumentTypeListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RegulatoryComplianceListInstance(version: V2): RegulatoryComplianceListInstance;
|
||||
86
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js
generated
vendored
Normal file
86
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.RegulatoryComplianceListInstance = RegulatoryComplianceListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const bundle_1 = require("./regulatoryCompliance/bundle");
|
||||
const endUser_1 = require("./regulatoryCompliance/endUser");
|
||||
const endUserType_1 = require("./regulatoryCompliance/endUserType");
|
||||
const regulation_1 = require("./regulatoryCompliance/regulation");
|
||||
const supportingDocument_1 = require("./regulatoryCompliance/supportingDocument");
|
||||
const supportingDocumentType_1 = require("./regulatoryCompliance/supportingDocumentType");
|
||||
function RegulatoryComplianceListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance`;
|
||||
Object.defineProperty(instance, "bundles", {
|
||||
get: function bundles() {
|
||||
if (!instance._bundles) {
|
||||
instance._bundles = (0, bundle_1.BundleListInstance)(instance._version);
|
||||
}
|
||||
return instance._bundles;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "endUsers", {
|
||||
get: function endUsers() {
|
||||
if (!instance._endUsers) {
|
||||
instance._endUsers = (0, endUser_1.EndUserListInstance)(instance._version);
|
||||
}
|
||||
return instance._endUsers;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "endUserTypes", {
|
||||
get: function endUserTypes() {
|
||||
if (!instance._endUserTypes) {
|
||||
instance._endUserTypes = (0, endUserType_1.EndUserTypeListInstance)(instance._version);
|
||||
}
|
||||
return instance._endUserTypes;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "regulations", {
|
||||
get: function regulations() {
|
||||
if (!instance._regulations) {
|
||||
instance._regulations = (0, regulation_1.RegulationListInstance)(instance._version);
|
||||
}
|
||||
return instance._regulations;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "supportingDocuments", {
|
||||
get: function supportingDocuments() {
|
||||
if (!instance._supportingDocuments) {
|
||||
instance._supportingDocuments = (0, supportingDocument_1.SupportingDocumentListInstance)(instance._version);
|
||||
}
|
||||
return instance._supportingDocuments;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "supportingDocumentTypes", {
|
||||
get: function supportingDocumentTypes() {
|
||||
if (!instance._supportingDocumentTypes) {
|
||||
instance._supportingDocumentTypes = (0, supportingDocumentType_1.SupportingDocumentTypeListInstance)(instance._version);
|
||||
}
|
||||
return instance._supportingDocumentTypes;
|
||||
},
|
||||
});
|
||||
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;
|
||||
}
|
||||
592
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts
generated
vendored
Normal file
592
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,592 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
import { BundleCopyListInstance } from "./bundle/bundleCopy";
|
||||
import { EvaluationListInstance } from "./bundle/evaluation";
|
||||
import { ItemAssignmentListInstance } from "./bundle/itemAssignment";
|
||||
import { ReplaceItemsListInstance } from "./bundle/replaceItems";
|
||||
export type BundleEndUserType = "individual" | "business";
|
||||
export type BundleSortBy = "valid-until" | "date-updated";
|
||||
export type BundleSortDirection = "ASC" | "DESC";
|
||||
/**
|
||||
* The verification status of the Bundle resource.
|
||||
*/
|
||||
export type BundleStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved";
|
||||
/**
|
||||
* Options to pass to update a BundleInstance
|
||||
*/
|
||||
export interface BundleContextUpdateOptions {
|
||||
/** */
|
||||
status?: BundleStatus;
|
||||
/** The URL we call to inform your application of status changes. */
|
||||
statusCallback?: string;
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName?: string;
|
||||
/** The email address that will receive updates when the Bundle resource changes status. */
|
||||
email?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a BundleInstance
|
||||
*/
|
||||
export interface BundleListInstanceCreateOptions {
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName: string;
|
||||
/** The email address that will receive updates when the Bundle resource changes status. */
|
||||
email: string;
|
||||
/** The URL we call to inform your application of status changes. */
|
||||
statusCallback?: string;
|
||||
/** The unique string of a regulation that is associated to the Bundle resource. */
|
||||
regulationSid?: string;
|
||||
/** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\\\'s phone number country ownership request. */
|
||||
isoCountry?: string;
|
||||
/** */
|
||||
endUserType?: BundleEndUserType;
|
||||
/** The type of phone number of the Bundle\\\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
||||
numberType?: string;
|
||||
/** Indicates that Bundle is a Test Bundle and will be Auto-Rejected */
|
||||
isTest?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface BundleListInstanceEachOptions {
|
||||
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
||||
status?: BundleStatus;
|
||||
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
||||
bundleSids?: string;
|
||||
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
||||
friendlyName?: string;
|
||||
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
||||
regulationSid?: string;
|
||||
/** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
||||
numberType?: string;
|
||||
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
||||
endUserType?: "business" | "individual";
|
||||
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
||||
hasValidUntilDate?: boolean;
|
||||
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
||||
sortBy?: BundleSortBy;
|
||||
/** Default is `DESC`. Can be `ASC` or `DESC`. */
|
||||
sortDirection?: BundleSortDirection;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDate?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateBefore?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateAfter?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: BundleInstance, 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 BundleListInstanceOptions {
|
||||
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
||||
status?: BundleStatus;
|
||||
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
||||
bundleSids?: string;
|
||||
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
||||
friendlyName?: string;
|
||||
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
||||
regulationSid?: string;
|
||||
/** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
||||
numberType?: string;
|
||||
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
||||
endUserType?: "business" | "individual";
|
||||
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
||||
hasValidUntilDate?: boolean;
|
||||
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
||||
sortBy?: BundleSortBy;
|
||||
/** Default is `DESC`. Can be `ASC` or `DESC`. */
|
||||
sortDirection?: BundleSortDirection;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDate?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateBefore?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateAfter?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface BundleListInstancePageOptions {
|
||||
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
||||
status?: BundleStatus;
|
||||
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
||||
bundleSids?: string;
|
||||
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
||||
friendlyName?: string;
|
||||
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
||||
regulationSid?: string;
|
||||
/** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
||||
numberType?: string;
|
||||
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
||||
endUserType?: "business" | "individual";
|
||||
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
||||
hasValidUntilDate?: boolean;
|
||||
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
||||
sortBy?: BundleSortBy;
|
||||
/** Default is `DESC`. Can be `ASC` or `DESC`. */
|
||||
sortDirection?: BundleSortDirection;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDate?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateBefore?: Date;
|
||||
/** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
|
||||
validUntilDateAfter?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface BundleContext {
|
||||
bundleCopies: BundleCopyListInstance;
|
||||
evaluations: EvaluationListInstance;
|
||||
itemAssignments: ItemAssignmentListInstance;
|
||||
replaceItems: ReplaceItemsListInstance;
|
||||
/**
|
||||
* Remove a BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a BundleInstance 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 BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Fetch a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Update a BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Update a BundleInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
update(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Update a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Update a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface BundleContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class BundleContextImpl implements BundleContext {
|
||||
protected _version: V2;
|
||||
protected _solution: BundleContextSolution;
|
||||
protected _uri: string;
|
||||
protected _bundleCopies?: BundleCopyListInstance;
|
||||
protected _evaluations?: EvaluationListInstance;
|
||||
protected _itemAssignments?: ItemAssignmentListInstance;
|
||||
protected _replaceItems?: ReplaceItemsListInstance;
|
||||
constructor(_version: V2, sid: string);
|
||||
get bundleCopies(): BundleCopyListInstance;
|
||||
get evaluations(): EvaluationListInstance;
|
||||
get itemAssignments(): ItemAssignmentListInstance;
|
||||
get replaceItems(): ReplaceItemsListInstance;
|
||||
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?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
update(params?: BundleContextUpdateOptions | ((error: Error | null, item?: BundleInstance) => any), callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
updateWithHttpInfo(params?: BundleContextUpdateOptions | ((error: Error | null, item?: ApiResponse<BundleInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): BundleContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface BundlePayload extends TwilioResponsePayload {
|
||||
results: BundleResource[];
|
||||
}
|
||||
interface BundleResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
regulation_sid: string;
|
||||
friendly_name: string;
|
||||
status: BundleStatus;
|
||||
valid_until: Date;
|
||||
email: string;
|
||||
status_callback: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class BundleInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: BundleContextSolution;
|
||||
protected _context?: BundleContext;
|
||||
constructor(_version: V2, payload: BundleResource, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string of a regulation that is associated to the Bundle resource.
|
||||
*/
|
||||
regulationSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: BundleStatus;
|
||||
/**
|
||||
* The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until.
|
||||
*/
|
||||
validUntil: Date;
|
||||
/**
|
||||
* The email address that will receive updates when the Bundle resource changes status.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* The URL we call to inform your application of status changes.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the Bundle resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The URLs of the Assigned Items of the Bundle resource.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a BundleInstance 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 BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Fetch a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Update a BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Update a BundleInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
update(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Update a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Update a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Access the bundleCopies.
|
||||
*/
|
||||
bundleCopies(): BundleCopyListInstance;
|
||||
/**
|
||||
* Access the evaluations.
|
||||
*/
|
||||
evaluations(): EvaluationListInstance;
|
||||
/**
|
||||
* Access the itemAssignments.
|
||||
*/
|
||||
itemAssignments(): ItemAssignmentListInstance;
|
||||
/**
|
||||
* Access the replaceItems.
|
||||
*/
|
||||
replaceItems(): ReplaceItemsListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
regulationSid: string;
|
||||
friendlyName: string;
|
||||
status: BundleStatus;
|
||||
validUntil: Date;
|
||||
email: string;
|
||||
statusCallback: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface BundleSolution {
|
||||
}
|
||||
export interface BundleListInstance {
|
||||
_version: V2;
|
||||
_solution: BundleSolution;
|
||||
_uri: string;
|
||||
(sid: string): BundleContext;
|
||||
get(sid: string): BundleContext;
|
||||
/**
|
||||
* Create a BundleInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
create(params: BundleListInstanceCreateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise<BundleInstance>;
|
||||
/**
|
||||
* Create a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: BundleListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleInstance>) => any): Promise<ApiResponse<BundleInstance>>;
|
||||
/**
|
||||
* Streams BundleInstance 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 { BundleListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: BundleListInstanceEachOptions, callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams BundleInstance 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 { BundleListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: BundleListInstanceEachOptions, callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of BundleInstance 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: BundlePage) => any): Promise<BundlePage>;
|
||||
/**
|
||||
* Retrieve a single target page of BundleInstance 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<BundlePage>) => any): Promise<ApiResponse<BundlePage>>;
|
||||
/**
|
||||
* Lists BundleInstance 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 { BundleListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: BundleInstance[]) => any): Promise<BundleInstance[]>;
|
||||
list(params: BundleListInstanceOptions, callback?: (error: Error | null, items: BundleInstance[]) => any): Promise<BundleInstance[]>;
|
||||
/**
|
||||
* Lists BundleInstance 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 { BundleListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<BundleInstance[]>) => any): Promise<ApiResponse<BundleInstance[]>>;
|
||||
listWithHttpInfo(params: BundleListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<BundleInstance[]>) => any): Promise<ApiResponse<BundleInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of BundleInstance 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 { BundleListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: BundlePage) => any): Promise<BundlePage>;
|
||||
page(params: BundleListInstancePageOptions, callback?: (error: Error | null, items: BundlePage) => any): Promise<BundlePage>;
|
||||
/**
|
||||
* Retrieve a single page of BundleInstance 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 { BundleListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<BundlePage>) => any): Promise<ApiResponse<BundlePage>>;
|
||||
pageWithHttpInfo(params: BundleListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<BundlePage>) => any): Promise<ApiResponse<BundlePage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BundleListInstance(version: V2): BundleListInstance;
|
||||
export declare class BundlePage extends Page<V2, BundlePayload, BundleResource, BundleInstance> {
|
||||
/**
|
||||
* Initialize the BundlePage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: BundleSolution);
|
||||
/**
|
||||
* Build an instance of BundleInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: BundleResource): BundleInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
580
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js
generated
vendored
Normal file
580
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js
generated
vendored
Normal file
@@ -0,0 +1,580 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.BundlePage = exports.BundleInstance = exports.BundleContextImpl = void 0;
|
||||
exports.BundleListInstance = BundleListInstance;
|
||||
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 bundleCopy_1 = require("./bundle/bundleCopy");
|
||||
const evaluation_1 = require("./bundle/evaluation");
|
||||
const itemAssignment_1 = require("./bundle/itemAssignment");
|
||||
const replaceItems_1 = require("./bundle/replaceItems");
|
||||
class BundleContextImpl {
|
||||
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 = `/RegulatoryCompliance/Bundles/${sid}`;
|
||||
}
|
||||
get bundleCopies() {
|
||||
this._bundleCopies =
|
||||
this._bundleCopies ||
|
||||
(0, bundleCopy_1.BundleCopyListInstance)(this._version, this._solution.sid);
|
||||
return this._bundleCopies;
|
||||
}
|
||||
get evaluations() {
|
||||
this._evaluations =
|
||||
this._evaluations ||
|
||||
(0, evaluation_1.EvaluationListInstance)(this._version, this._solution.sid);
|
||||
return this._evaluations;
|
||||
}
|
||||
get itemAssignments() {
|
||||
this._itemAssignments =
|
||||
this._itemAssignments ||
|
||||
(0, itemAssignment_1.ItemAssignmentListInstance)(this._version, this._solution.sid);
|
||||
return this._itemAssignments;
|
||||
}
|
||||
get replaceItems() {
|
||||
this._replaceItems =
|
||||
this._replaceItems ||
|
||||
(0, replaceItems_1.ReplaceItemsListInstance)(this._version, this._solution.sid);
|
||||
return this._replaceItems;
|
||||
}
|
||||
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 BundleInstance(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 BundleInstance(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["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["email"] !== undefined)
|
||||
data["Email"] = params["email"];
|
||||
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 BundleInstance(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["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["email"] !== undefined)
|
||||
data["Email"] = params["email"];
|
||||
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 BundleInstance(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.BundleContextImpl = BundleContextImpl;
|
||||
class BundleInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.regulationSid = payload.regulation_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.validUntil = deserialize.iso8601DateTime(payload.valid_until);
|
||||
this.email = payload.email;
|
||||
this.statusCallback = payload.status_callback;
|
||||
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 BundleContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a BundleInstance 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 BundleInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a BundleInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleInstance 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 bundleCopies.
|
||||
*/
|
||||
bundleCopies() {
|
||||
return this._proxy.bundleCopies;
|
||||
}
|
||||
/**
|
||||
* Access the evaluations.
|
||||
*/
|
||||
evaluations() {
|
||||
return this._proxy.evaluations;
|
||||
}
|
||||
/**
|
||||
* Access the itemAssignments.
|
||||
*/
|
||||
itemAssignments() {
|
||||
return this._proxy.itemAssignments;
|
||||
}
|
||||
/**
|
||||
* Access the replaceItems.
|
||||
*/
|
||||
replaceItems() {
|
||||
return this._proxy.replaceItems;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
accountSid: this.accountSid,
|
||||
regulationSid: this.regulationSid,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
validUntil: this.validUntil,
|
||||
email: this.email,
|
||||
statusCallback: this.statusCallback,
|
||||
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.BundleInstance = BundleInstance;
|
||||
function BundleListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new BundleContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/Bundles`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Email"] = params["email"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["regulationSid"] !== undefined)
|
||||
data["RegulationSid"] = params["regulationSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["isTest"] !== undefined)
|
||||
data["IsTest"] = serialize.bool(params["isTest"]);
|
||||
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 BundleInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["email"] === null || params["email"] === undefined) {
|
||||
throw new Error("Required parameter \"params['email']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Email"] = params["email"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["regulationSid"] !== undefined)
|
||||
data["RegulationSid"] = params["regulationSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["isTest"] !== undefined)
|
||||
data["IsTest"] = serialize.bool(params["isTest"]);
|
||||
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 BundleInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["bundleSids"] !== undefined)
|
||||
data["BundleSids"] = params["bundleSids"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["regulationSid"] !== undefined)
|
||||
data["RegulationSid"] = params["regulationSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["hasValidUntilDate"] !== undefined)
|
||||
data["HasValidUntilDate"] = serialize.bool(params["hasValidUntilDate"]);
|
||||
if (params["sortBy"] !== undefined)
|
||||
data["SortBy"] = params["sortBy"];
|
||||
if (params["sortDirection"] !== undefined)
|
||||
data["SortDirection"] = params["sortDirection"];
|
||||
if (params["validUntilDate"] !== undefined)
|
||||
data["ValidUntilDate"] = serialize.iso8601DateTime(params["validUntilDate"]);
|
||||
if (params["validUntilDateBefore"] !== undefined)
|
||||
data["ValidUntilDate<"] = serialize.iso8601DateTime(params["validUntilDateBefore"]);
|
||||
if (params["validUntilDateAfter"] !== undefined)
|
||||
data["ValidUntilDate>"] = serialize.iso8601DateTime(params["validUntilDateAfter"]);
|
||||
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 BundlePage(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 BundlePage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["bundleSids"] !== undefined)
|
||||
data["BundleSids"] = params["bundleSids"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["regulationSid"] !== undefined)
|
||||
data["RegulationSid"] = params["regulationSid"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["hasValidUntilDate"] !== undefined)
|
||||
data["HasValidUntilDate"] = serialize.bool(params["hasValidUntilDate"]);
|
||||
if (params["sortBy"] !== undefined)
|
||||
data["SortBy"] = params["sortBy"];
|
||||
if (params["sortDirection"] !== undefined)
|
||||
data["SortDirection"] = params["sortDirection"];
|
||||
if (params["validUntilDate"] !== undefined)
|
||||
data["ValidUntilDate"] = serialize.iso8601DateTime(params["validUntilDate"]);
|
||||
if (params["validUntilDateBefore"] !== undefined)
|
||||
data["ValidUntilDate<"] = serialize.iso8601DateTime(params["validUntilDateBefore"]);
|
||||
if (params["validUntilDateAfter"] !== undefined)
|
||||
data["ValidUntilDate>"] = serialize.iso8601DateTime(params["validUntilDateAfter"]);
|
||||
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 BundlePage(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 BundlePage(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 BundlePage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the BundlePage
|
||||
*
|
||||
* @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 BundleInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new BundleInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BundlePage = BundlePage;
|
||||
291
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts
generated
vendored
Normal file
291
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
||||
import Response from "../../../../../http/response";
|
||||
import V2 from "../../../V2";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The verification status of the Bundle resource.
|
||||
*/
|
||||
export type BundleCopyStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved";
|
||||
/**
|
||||
* Options to pass to create a BundleCopyInstance
|
||||
*/
|
||||
export interface BundleCopyListInstanceCreateOptions {
|
||||
/** The string that you assigned to describe the copied bundle. */
|
||||
friendlyName?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface BundleCopyListInstanceEachOptions {
|
||||
/** 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: BundleCopyInstance, 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 BundleCopyListInstanceOptions {
|
||||
/** 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 BundleCopyListInstancePageOptions {
|
||||
/** 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 BundleCopySolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export interface BundleCopyListInstance {
|
||||
_version: V2;
|
||||
_solution: BundleCopySolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a BundleCopyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCopyInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: BundleCopyInstance) => any): Promise<BundleCopyInstance>;
|
||||
/**
|
||||
* Create a BundleCopyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCopyInstance
|
||||
*/
|
||||
create(params: BundleCopyListInstanceCreateOptions, callback?: (error: Error | null, item?: BundleCopyInstance) => any): Promise<BundleCopyInstance>;
|
||||
/**
|
||||
* Create a BundleCopyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCopyInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<BundleCopyInstance>) => any): Promise<ApiResponse<BundleCopyInstance>>;
|
||||
/**
|
||||
* Create a BundleCopyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BundleCopyInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: BundleCopyListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BundleCopyInstance>) => any): Promise<ApiResponse<BundleCopyInstance>>;
|
||||
/**
|
||||
* Streams BundleCopyInstance 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 { BundleCopyListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: BundleCopyListInstanceEachOptions, callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams BundleCopyInstance 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 { BundleCopyListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: BundleCopyListInstanceEachOptions, callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of BundleCopyInstance 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: BundleCopyPage) => any): Promise<BundleCopyPage>;
|
||||
/**
|
||||
* Retrieve a single target page of BundleCopyInstance 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<BundleCopyPage>) => any): Promise<ApiResponse<BundleCopyPage>>;
|
||||
/**
|
||||
* Lists BundleCopyInstance 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 { BundleCopyListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise<BundleCopyInstance[]>;
|
||||
list(params: BundleCopyListInstanceOptions, callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise<BundleCopyInstance[]>;
|
||||
/**
|
||||
* Lists BundleCopyInstance 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 { BundleCopyListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<BundleCopyInstance[]>) => any): Promise<ApiResponse<BundleCopyInstance[]>>;
|
||||
listWithHttpInfo(params: BundleCopyListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<BundleCopyInstance[]>) => any): Promise<ApiResponse<BundleCopyInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of BundleCopyInstance 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 { BundleCopyListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
|
||||
page(params: BundleCopyListInstancePageOptions, callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
|
||||
/**
|
||||
* Retrieve a single page of BundleCopyInstance 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 { BundleCopyListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<BundleCopyPage>) => any): Promise<ApiResponse<BundleCopyPage>>;
|
||||
pageWithHttpInfo(params: BundleCopyListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<BundleCopyPage>) => any): Promise<ApiResponse<BundleCopyPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BundleCopyListInstance(version: V2, bundleSid: string): BundleCopyListInstance;
|
||||
interface BundleCopyPayload extends TwilioResponsePayload {
|
||||
results: BundleCopyResource[];
|
||||
}
|
||||
interface BundleCopyResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
regulation_sid: string;
|
||||
friendly_name: string;
|
||||
status: BundleCopyStatus;
|
||||
valid_until: Date;
|
||||
email: string;
|
||||
status_callback: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
}
|
||||
export declare class BundleCopyInstance {
|
||||
protected _version: V2;
|
||||
constructor(_version: V2, payload: BundleCopyResource, bundleSid: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string of a regulation that is associated to the Bundle resource.
|
||||
*/
|
||||
regulationSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: BundleCopyStatus;
|
||||
/**
|
||||
* The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until.
|
||||
*/
|
||||
validUntil: Date;
|
||||
/**
|
||||
* The email address that will receive updates when the Bundle resource changes status.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* The URL we call to inform your application of status changes.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
regulationSid: string;
|
||||
friendlyName: string;
|
||||
status: BundleCopyStatus;
|
||||
validUntil: Date;
|
||||
email: string;
|
||||
statusCallback: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class BundleCopyPage extends Page<V2, BundleCopyPayload, BundleCopyResource, BundleCopyInstance> {
|
||||
/**
|
||||
* Initialize the BundleCopyPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: BundleCopySolution);
|
||||
/**
|
||||
* Build an instance of BundleCopyInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: BundleCopyResource): BundleCopyInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
243
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js
generated
vendored
Normal file
243
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.BundleCopyPage = exports.BundleCopyInstance = void 0;
|
||||
exports.BundleCopyListInstance = BundleCopyListInstance;
|
||||
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 BundleCopyListInstance(version, bundleSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { bundleSid };
|
||||
instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Copies`;
|
||||
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 BundleCopyInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
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 BundleCopyInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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 BundleCopyPage(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 BundleCopyPage(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 BundleCopyPage(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 BundleCopyPage(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 BundleCopyInstance {
|
||||
constructor(_version, payload, bundleSid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.regulationSid = payload.regulation_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.validUntil = deserialize.iso8601DateTime(payload.valid_until);
|
||||
this.email = payload.email;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
accountSid: this.accountSid,
|
||||
regulationSid: this.regulationSid,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
validUntil: this.validUntil,
|
||||
email: this.email,
|
||||
statusCallback: this.statusCallback,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BundleCopyInstance = BundleCopyInstance;
|
||||
class BundleCopyPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the BundleCopyPage
|
||||
*
|
||||
* @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 BundleCopyInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new BundleCopyInstance(this._version, payload, this._solution.bundleSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BundleCopyPage = BundleCopyPage;
|
||||
311
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts
generated
vendored
Normal file
311
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,311 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
||||
import Response from "../../../../../http/response";
|
||||
import V2 from "../../../V2";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The compliance status of the Evaluation resource.
|
||||
*/
|
||||
export type EvaluationStatus = "compliant" | "noncompliant";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface EvaluationListInstanceEachOptions {
|
||||
/** 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: EvaluationInstance, 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 EvaluationListInstanceOptions {
|
||||
/** 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 EvaluationListInstancePageOptions {
|
||||
/** 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 EvaluationContext {
|
||||
/**
|
||||
* Fetch a EvaluationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise<EvaluationInstance>;
|
||||
/**
|
||||
* Fetch a EvaluationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EvaluationInstance>) => any): Promise<ApiResponse<EvaluationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface EvaluationContextSolution {
|
||||
bundleSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class EvaluationContextImpl implements EvaluationContext {
|
||||
protected _version: V2;
|
||||
protected _solution: EvaluationContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, bundleSid: string, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise<EvaluationInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EvaluationInstance>) => any): Promise<ApiResponse<EvaluationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): EvaluationContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface EvaluationPayload extends TwilioResponsePayload {
|
||||
results: EvaluationResource[];
|
||||
}
|
||||
interface EvaluationResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
regulation_sid: string;
|
||||
bundle_sid: string;
|
||||
status: EvaluationStatus;
|
||||
results: Array<any>;
|
||||
date_created: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class EvaluationInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: EvaluationContextSolution;
|
||||
protected _context?: EvaluationContext;
|
||||
constructor(_version: V2, payload: EvaluationResource, bundleSid: string, sid?: string);
|
||||
/**
|
||||
* The unique string that identifies the Evaluation resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string of a regulation that is associated to the Bundle resource.
|
||||
*/
|
||||
regulationSid: string;
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
bundleSid: string;
|
||||
status: EvaluationStatus;
|
||||
/**
|
||||
* The results of the Evaluation which includes the valid and invalid attributes.
|
||||
*/
|
||||
results: Array<any>;
|
||||
dateCreated: Date;
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a EvaluationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise<EvaluationInstance>;
|
||||
/**
|
||||
* Fetch a EvaluationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EvaluationInstance>) => any): Promise<ApiResponse<EvaluationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
regulationSid: string;
|
||||
bundleSid: string;
|
||||
status: EvaluationStatus;
|
||||
results: any[];
|
||||
dateCreated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface EvaluationSolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export interface EvaluationListInstance {
|
||||
_version: V2;
|
||||
_solution: EvaluationSolution;
|
||||
_uri: string;
|
||||
(sid: string): EvaluationContext;
|
||||
get(sid: string): EvaluationContext;
|
||||
/**
|
||||
* Create a EvaluationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise<EvaluationInstance>;
|
||||
/**
|
||||
* Create a EvaluationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EvaluationInstance>) => any): Promise<ApiResponse<EvaluationInstance>>;
|
||||
/**
|
||||
* Streams EvaluationInstance 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 { EvaluationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: EvaluationListInstanceEachOptions, callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams EvaluationInstance 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 { EvaluationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: EvaluationListInstanceEachOptions, callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of EvaluationInstance 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: EvaluationPage) => any): Promise<EvaluationPage>;
|
||||
/**
|
||||
* Retrieve a single target page of EvaluationInstance 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<EvaluationPage>) => any): Promise<ApiResponse<EvaluationPage>>;
|
||||
/**
|
||||
* Lists EvaluationInstance 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 { EvaluationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: EvaluationInstance[]) => any): Promise<EvaluationInstance[]>;
|
||||
list(params: EvaluationListInstanceOptions, callback?: (error: Error | null, items: EvaluationInstance[]) => any): Promise<EvaluationInstance[]>;
|
||||
/**
|
||||
* Lists EvaluationInstance 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 { EvaluationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EvaluationInstance[]>) => any): Promise<ApiResponse<EvaluationInstance[]>>;
|
||||
listWithHttpInfo(params: EvaluationListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<EvaluationInstance[]>) => any): Promise<ApiResponse<EvaluationInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of EvaluationInstance 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 { EvaluationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: EvaluationPage) => any): Promise<EvaluationPage>;
|
||||
page(params: EvaluationListInstancePageOptions, callback?: (error: Error | null, items: EvaluationPage) => any): Promise<EvaluationPage>;
|
||||
/**
|
||||
* Retrieve a single page of EvaluationInstance 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 { EvaluationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EvaluationPage>) => any): Promise<ApiResponse<EvaluationPage>>;
|
||||
pageWithHttpInfo(params: EvaluationListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<EvaluationPage>) => any): Promise<ApiResponse<EvaluationPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function EvaluationListInstance(version: V2, bundleSid: string): EvaluationListInstance;
|
||||
export declare class EvaluationPage extends Page<V2, EvaluationPayload, EvaluationResource, EvaluationInstance> {
|
||||
/**
|
||||
* Initialize the EvaluationPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: EvaluationSolution);
|
||||
/**
|
||||
* Build an instance of EvaluationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: EvaluationResource): EvaluationInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
302
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js
generated
vendored
Normal file
302
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js
generated
vendored
Normal file
@@ -0,0 +1,302 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.EvaluationPage = exports.EvaluationInstance = exports.EvaluationContextImpl = void 0;
|
||||
exports.EvaluationListInstance = EvaluationListInstance;
|
||||
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 EvaluationContextImpl {
|
||||
constructor(_version, bundleSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { bundleSid, sid };
|
||||
this._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Evaluations/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new EvaluationInstance(operationVersion, payload, instance._solution.bundleSid, 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 EvaluationInstance(operationVersion, response.body, instance._solution.bundleSid, 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.EvaluationContextImpl = EvaluationContextImpl;
|
||||
class EvaluationInstance {
|
||||
constructor(_version, payload, bundleSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.regulationSid = payload.regulation_sid;
|
||||
this.bundleSid = payload.bundle_sid;
|
||||
this.status = payload.status;
|
||||
this.results = payload.results;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.url = payload.url;
|
||||
this._solution = { bundleSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new EvaluationContextImpl(this._version, this._solution.bundleSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a EvaluationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a EvaluationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EvaluationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
accountSid: this.accountSid,
|
||||
regulationSid: this.regulationSid,
|
||||
bundleSid: this.bundleSid,
|
||||
status: this.status,
|
||||
results: this.results,
|
||||
dateCreated: this.dateCreated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EvaluationInstance = EvaluationInstance;
|
||||
function EvaluationListInstance(version, bundleSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new EvaluationContextImpl(version, bundleSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { bundleSid };
|
||||
instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Evaluations`;
|
||||
instance.create = function create(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new EvaluationInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new EvaluationInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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 EvaluationPage(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 EvaluationPage(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 EvaluationPage(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 EvaluationPage(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 EvaluationPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the EvaluationPage
|
||||
*
|
||||
* @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 EvaluationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new EvaluationInstance(this._version, payload, this._solution.bundleSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EvaluationPage = EvaluationPage;
|
||||
347
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts
generated
vendored
Normal file
347
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts
generated
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
||||
import Response from "../../../../../http/response";
|
||||
import V2 from "../../../V2";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a ItemAssignmentInstance
|
||||
*/
|
||||
export interface ItemAssignmentListInstanceCreateOptions {
|
||||
/** The SID of an object bag that holds information of the different items. */
|
||||
objectSid: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ItemAssignmentListInstanceEachOptions {
|
||||
/** 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: ItemAssignmentInstance, 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 ItemAssignmentListInstanceOptions {
|
||||
/** 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 ItemAssignmentListInstancePageOptions {
|
||||
/** 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 ItemAssignmentContext {
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance 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 ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise<ItemAssignmentInstance>;
|
||||
/**
|
||||
* Fetch a ItemAssignmentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ItemAssignmentInstance>) => any): Promise<ApiResponse<ItemAssignmentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ItemAssignmentContextSolution {
|
||||
bundleSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class ItemAssignmentContextImpl implements ItemAssignmentContext {
|
||||
protected _version: V2;
|
||||
protected _solution: ItemAssignmentContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, bundleSid: 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?: ItemAssignmentInstance) => any): Promise<ItemAssignmentInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ItemAssignmentInstance>) => any): Promise<ApiResponse<ItemAssignmentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ItemAssignmentContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ItemAssignmentPayload extends TwilioResponsePayload {
|
||||
results: ItemAssignmentResource[];
|
||||
}
|
||||
interface ItemAssignmentResource {
|
||||
sid: string;
|
||||
bundle_sid: string;
|
||||
account_sid: string;
|
||||
object_sid: string;
|
||||
date_created: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class ItemAssignmentInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: ItemAssignmentContextSolution;
|
||||
protected _context?: ItemAssignmentContext;
|
||||
constructor(_version: V2, payload: ItemAssignmentResource, bundleSid: string, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Item Assignment resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
bundleSid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The SID of an object bag that holds information of the different items.
|
||||
*/
|
||||
objectSid: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The absolute URL of the Identity resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance 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 ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise<ItemAssignmentInstance>;
|
||||
/**
|
||||
* Fetch a ItemAssignmentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ItemAssignmentInstance>) => any): Promise<ApiResponse<ItemAssignmentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
bundleSid: string;
|
||||
accountSid: string;
|
||||
objectSid: string;
|
||||
dateCreated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ItemAssignmentSolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export interface ItemAssignmentListInstance {
|
||||
_version: V2;
|
||||
_solution: ItemAssignmentSolution;
|
||||
_uri: string;
|
||||
(sid: string): ItemAssignmentContext;
|
||||
get(sid: string): ItemAssignmentContext;
|
||||
/**
|
||||
* Create a ItemAssignmentInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance
|
||||
*/
|
||||
create(params: ItemAssignmentListInstanceCreateOptions, callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise<ItemAssignmentInstance>;
|
||||
/**
|
||||
* Create a ItemAssignmentInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: ItemAssignmentListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<ItemAssignmentInstance>) => any): Promise<ApiResponse<ItemAssignmentInstance>>;
|
||||
/**
|
||||
* Streams ItemAssignmentInstance 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 { ItemAssignmentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ItemAssignmentListInstanceEachOptions, callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ItemAssignmentInstance 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 { ItemAssignmentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ItemAssignmentListInstanceEachOptions, callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ItemAssignmentInstance 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: ItemAssignmentPage) => any): Promise<ItemAssignmentPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ItemAssignmentInstance 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<ItemAssignmentPage>) => any): Promise<ApiResponse<ItemAssignmentPage>>;
|
||||
/**
|
||||
* Lists ItemAssignmentInstance 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 { ItemAssignmentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ItemAssignmentInstance[]) => any): Promise<ItemAssignmentInstance[]>;
|
||||
list(params: ItemAssignmentListInstanceOptions, callback?: (error: Error | null, items: ItemAssignmentInstance[]) => any): Promise<ItemAssignmentInstance[]>;
|
||||
/**
|
||||
* Lists ItemAssignmentInstance 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 { ItemAssignmentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ItemAssignmentInstance[]>) => any): Promise<ApiResponse<ItemAssignmentInstance[]>>;
|
||||
listWithHttpInfo(params: ItemAssignmentListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ItemAssignmentInstance[]>) => any): Promise<ApiResponse<ItemAssignmentInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ItemAssignmentInstance 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 { ItemAssignmentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ItemAssignmentPage) => any): Promise<ItemAssignmentPage>;
|
||||
page(params: ItemAssignmentListInstancePageOptions, callback?: (error: Error | null, items: ItemAssignmentPage) => any): Promise<ItemAssignmentPage>;
|
||||
/**
|
||||
* Retrieve a single page of ItemAssignmentInstance 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 { ItemAssignmentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ItemAssignmentPage>) => any): Promise<ApiResponse<ItemAssignmentPage>>;
|
||||
pageWithHttpInfo(params: ItemAssignmentListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ItemAssignmentPage>) => any): Promise<ApiResponse<ItemAssignmentPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ItemAssignmentListInstance(version: V2, bundleSid: string): ItemAssignmentListInstance;
|
||||
export declare class ItemAssignmentPage extends Page<V2, ItemAssignmentPayload, ItemAssignmentResource, ItemAssignmentInstance> {
|
||||
/**
|
||||
* Initialize the ItemAssignmentPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: ItemAssignmentSolution);
|
||||
/**
|
||||
* Build an instance of ItemAssignmentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ItemAssignmentResource): ItemAssignmentInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
363
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js
generated
vendored
Normal file
363
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js
generated
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.ItemAssignmentPage = exports.ItemAssignmentInstance = exports.ItemAssignmentContextImpl = void 0;
|
||||
exports.ItemAssignmentListInstance = ItemAssignmentListInstance;
|
||||
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 ItemAssignmentContextImpl {
|
||||
constructor(_version, bundleSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { bundleSid, sid };
|
||||
this._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ItemAssignments/${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 ItemAssignmentInstance(operationVersion, payload, instance._solution.bundleSid, 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 ItemAssignmentInstance(operationVersion, response.body, instance._solution.bundleSid, 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.ItemAssignmentContextImpl = ItemAssignmentContextImpl;
|
||||
class ItemAssignmentInstance {
|
||||
constructor(_version, payload, bundleSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.bundleSid = payload.bundle_sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.objectSid = payload.object_sid;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.url = payload.url;
|
||||
this._solution = { bundleSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ItemAssignmentContextImpl(this._version, this._solution.bundleSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a ItemAssignmentInstance 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 ItemAssignmentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ItemAssignmentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ItemAssignmentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
bundleSid: this.bundleSid,
|
||||
accountSid: this.accountSid,
|
||||
objectSid: this.objectSid,
|
||||
dateCreated: this.dateCreated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ItemAssignmentInstance = ItemAssignmentInstance;
|
||||
function ItemAssignmentListInstance(version, bundleSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ItemAssignmentContextImpl(version, bundleSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { bundleSid };
|
||||
instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ItemAssignments`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["objectSid"] === null || params["objectSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['objectSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["ObjectSid"] = params["objectSid"];
|
||||
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 ItemAssignmentInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
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["objectSid"] === null || params["objectSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['objectSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["ObjectSid"] = params["objectSid"];
|
||||
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 ItemAssignmentInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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 ItemAssignmentPage(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 ItemAssignmentPage(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 ItemAssignmentPage(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 ItemAssignmentPage(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 ItemAssignmentPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ItemAssignmentPage
|
||||
*
|
||||
* @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 ItemAssignmentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ItemAssignmentInstance(this._version, payload, this._solution.bundleSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ItemAssignmentPage = ItemAssignmentPage;
|
||||
118
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts
generated
vendored
Normal file
118
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../../../V2";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The verification status of the Bundle resource.
|
||||
*/
|
||||
export type ReplaceItemsStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved";
|
||||
/**
|
||||
* Options to pass to create a ReplaceItemsInstance
|
||||
*/
|
||||
export interface ReplaceItemsListInstanceCreateOptions {
|
||||
/** The source bundle sid to copy the item assignments from. */
|
||||
fromBundleSid: string;
|
||||
}
|
||||
export interface ReplaceItemsSolution {
|
||||
bundleSid: string;
|
||||
}
|
||||
export interface ReplaceItemsListInstance {
|
||||
_version: V2;
|
||||
_solution: ReplaceItemsSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a ReplaceItemsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ReplaceItemsInstance
|
||||
*/
|
||||
create(params: ReplaceItemsListInstanceCreateOptions, callback?: (error: Error | null, item?: ReplaceItemsInstance) => any): Promise<ReplaceItemsInstance>;
|
||||
/**
|
||||
* Create a ReplaceItemsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ReplaceItemsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: ReplaceItemsListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<ReplaceItemsInstance>) => any): Promise<ApiResponse<ReplaceItemsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ReplaceItemsListInstance(version: V2, bundleSid: string): ReplaceItemsListInstance;
|
||||
interface ReplaceItemsResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
regulation_sid: string;
|
||||
friendly_name: string;
|
||||
status: ReplaceItemsStatus;
|
||||
valid_until: Date;
|
||||
email: string;
|
||||
status_callback: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
}
|
||||
export declare class ReplaceItemsInstance {
|
||||
protected _version: V2;
|
||||
constructor(_version: V2, payload: ReplaceItemsResource, bundleSid: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Bundle resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string of a regulation that is associated to the Bundle resource.
|
||||
*/
|
||||
regulationSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
status: ReplaceItemsStatus;
|
||||
/**
|
||||
* The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until.
|
||||
*/
|
||||
validUntil: Date;
|
||||
/**
|
||||
* The email address that will receive updates when the Bundle resource changes status.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* The URL we call to inform your application of status changes.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
regulationSid: string;
|
||||
friendlyName: string;
|
||||
status: ReplaceItemsStatus;
|
||||
validUntil: Date;
|
||||
email: string;
|
||||
statusCallback: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
127
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js
generated
vendored
Normal file
127
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.ReplaceItemsInstance = void 0;
|
||||
exports.ReplaceItemsListInstance = ReplaceItemsListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../../base/deserialize");
|
||||
const serialize = require("../../../../../base/serialize");
|
||||
const utility_1 = require("../../../../../base/utility");
|
||||
function ReplaceItemsListInstance(version, bundleSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(bundleSid)) {
|
||||
throw new Error("Parameter 'bundleSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { bundleSid };
|
||||
instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ReplaceItems`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["fromBundleSid"] === null ||
|
||||
params["fromBundleSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['fromBundleSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FromBundleSid"] = params["fromBundleSid"];
|
||||
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 ReplaceItemsInstance(operationVersion, payload, instance._solution.bundleSid));
|
||||
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["fromBundleSid"] === null ||
|
||||
params["fromBundleSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['fromBundleSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FromBundleSid"] = params["fromBundleSid"];
|
||||
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 ReplaceItemsInstance(operationVersion, response.body, instance._solution.bundleSid),
|
||||
}));
|
||||
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 ReplaceItemsInstance {
|
||||
constructor(_version, payload, bundleSid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.regulationSid = payload.regulation_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.status = payload.status;
|
||||
this.validUntil = deserialize.iso8601DateTime(payload.valid_until);
|
||||
this.email = payload.email;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
accountSid: this.accountSid,
|
||||
regulationSid: this.regulationSid,
|
||||
friendlyName: this.friendlyName,
|
||||
status: this.status,
|
||||
validUntil: this.validUntil,
|
||||
email: this.email,
|
||||
statusCallback: this.statusCallback,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ReplaceItemsInstance = ReplaceItemsInstance;
|
||||
441
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts
generated
vendored
Normal file
441
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* The type of end user of the Bundle resource - can be `individual` or `business`.
|
||||
*/
|
||||
export type EndUserType = "individual" | "business";
|
||||
/**
|
||||
* Options to pass to update a EndUserInstance
|
||||
*/
|
||||
export interface EndUserContextUpdateOptions {
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName?: string;
|
||||
/** The set of parameters that are the attributes of the End User resource which are derived End User Types. */
|
||||
attributes?: any;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a EndUserInstance
|
||||
*/
|
||||
export interface EndUserListInstanceCreateOptions {
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName: string;
|
||||
/** */
|
||||
type: EndUserType;
|
||||
/** The set of parameters that are the attributes of the End User resource which are derived End User Types. */
|
||||
attributes?: any;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface EndUserListInstanceEachOptions {
|
||||
/** 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: EndUserInstance, 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 EndUserListInstanceOptions {
|
||||
/** 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 EndUserListInstancePageOptions {
|
||||
/** 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 EndUserContext {
|
||||
/**
|
||||
* Remove a EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a EndUserInstance 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 EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Fetch a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Update a EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Update a EndUserInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Update a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Update a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface EndUserContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class EndUserContextImpl implements EndUserContext {
|
||||
protected _version: V2;
|
||||
protected _solution: EndUserContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, 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?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
update(params?: EndUserContextUpdateOptions | ((error: Error | null, item?: EndUserInstance) => any), callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
updateWithHttpInfo(params?: EndUserContextUpdateOptions | ((error: Error | null, item?: ApiResponse<EndUserInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): EndUserContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface EndUserPayload extends TwilioResponsePayload {
|
||||
results: EndUserResource[];
|
||||
}
|
||||
interface EndUserResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
friendly_name: string;
|
||||
type: EndUserType;
|
||||
attributes: any;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class EndUserInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: EndUserContextSolution;
|
||||
protected _context?: EndUserContext;
|
||||
constructor(_version: V2, payload: EndUserResource, sid?: string);
|
||||
/**
|
||||
* The unique string created by Twilio to identify the End User resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
type: EndUserType;
|
||||
/**
|
||||
* The set of parameters that are the attributes of the End Users resource which are listed in the End User Types.
|
||||
*/
|
||||
attributes: any;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the End User resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a EndUserInstance 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 EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Fetch a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Update a EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Update a EndUserInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Update a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Update a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
friendlyName: string;
|
||||
type: EndUserType;
|
||||
attributes: any;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface EndUserSolution {
|
||||
}
|
||||
export interface EndUserListInstance {
|
||||
_version: V2;
|
||||
_solution: EndUserSolution;
|
||||
_uri: string;
|
||||
(sid: string): EndUserContext;
|
||||
get(sid: string): EndUserContext;
|
||||
/**
|
||||
* Create a EndUserInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
create(params: EndUserListInstanceCreateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise<EndUserInstance>;
|
||||
/**
|
||||
* Create a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: EndUserListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<EndUserInstance>) => any): Promise<ApiResponse<EndUserInstance>>;
|
||||
/**
|
||||
* Streams EndUserInstance 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 { EndUserListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: EndUserListInstanceEachOptions, callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams EndUserInstance 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 { EndUserListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: EndUserListInstanceEachOptions, callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of EndUserInstance 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: EndUserPage) => any): Promise<EndUserPage>;
|
||||
/**
|
||||
* Retrieve a single target page of EndUserInstance 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<EndUserPage>) => any): Promise<ApiResponse<EndUserPage>>;
|
||||
/**
|
||||
* Lists EndUserInstance 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 { EndUserListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise<EndUserInstance[]>;
|
||||
list(params: EndUserListInstanceOptions, callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise<EndUserInstance[]>;
|
||||
/**
|
||||
* Lists EndUserInstance 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 { EndUserListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EndUserInstance[]>) => any): Promise<ApiResponse<EndUserInstance[]>>;
|
||||
listWithHttpInfo(params: EndUserListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<EndUserInstance[]>) => any): Promise<ApiResponse<EndUserInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of EndUserInstance 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 { EndUserListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: EndUserPage) => any): Promise<EndUserPage>;
|
||||
page(params: EndUserListInstancePageOptions, callback?: (error: Error | null, items: EndUserPage) => any): Promise<EndUserPage>;
|
||||
/**
|
||||
* Retrieve a single page of EndUserInstance 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 { EndUserListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EndUserPage>) => any): Promise<ApiResponse<EndUserPage>>;
|
||||
pageWithHttpInfo(params: EndUserListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<EndUserPage>) => any): Promise<ApiResponse<EndUserPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function EndUserListInstance(version: V2): EndUserListInstance;
|
||||
export declare class EndUserPage extends Page<V2, EndUserPayload, EndUserResource, EndUserInstance> {
|
||||
/**
|
||||
* Initialize the EndUserPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: EndUserSolution);
|
||||
/**
|
||||
* Build an instance of EndUserInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: EndUserResource): EndUserInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
441
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js
generated
vendored
Normal file
441
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.EndUserPage = exports.EndUserInstance = exports.EndUserContextImpl = void 0;
|
||||
exports.EndUserListInstance = EndUserListInstance;
|
||||
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 EndUserContextImpl {
|
||||
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 = `/RegulatoryCompliance/EndUsers/${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 EndUserInstance(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 EndUserInstance(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["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 EndUserInstance(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["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 EndUserInstance(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.EndUserContextImpl = EndUserContextImpl;
|
||||
class EndUserInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.type = payload.type;
|
||||
this.attributes = payload.attributes;
|
||||
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 EndUserContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a EndUserInstance 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 EndUserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a EndUserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserInstance 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,
|
||||
accountSid: this.accountSid,
|
||||
friendlyName: this.friendlyName,
|
||||
type: this.type,
|
||||
attributes: this.attributes,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EndUserInstance = EndUserInstance;
|
||||
function EndUserListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new EndUserContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/EndUsers`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["type"] === null || params["type"] === undefined) {
|
||||
throw new Error("Required parameter \"params['type']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Type"] = params["type"];
|
||||
if (params["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 EndUserInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["type"] === null || params["type"] === undefined) {
|
||||
throw new Error("Required parameter \"params['type']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Type"] = params["type"];
|
||||
if (params["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 EndUserInstance(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 EndUserPage(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 EndUserPage(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 EndUserPage(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 EndUserPage(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 EndUserPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the EndUserPage
|
||||
*
|
||||
* @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 EndUserInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new EndUserInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EndUserPage = EndUserPage;
|
||||
280
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts
generated
vendored
Normal file
280
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface EndUserTypeListInstanceEachOptions {
|
||||
/** 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: EndUserTypeInstance, 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 EndUserTypeListInstanceOptions {
|
||||
/** 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 EndUserTypeListInstancePageOptions {
|
||||
/** 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 EndUserTypeContext {
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise<EndUserTypeInstance>;
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserTypeInstance>) => any): Promise<ApiResponse<EndUserTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface EndUserTypeContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class EndUserTypeContextImpl implements EndUserTypeContext {
|
||||
protected _version: V2;
|
||||
protected _solution: EndUserTypeContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise<EndUserTypeInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserTypeInstance>) => any): Promise<ApiResponse<EndUserTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): EndUserTypeContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface EndUserTypePayload extends TwilioResponsePayload {
|
||||
end_user_types: EndUserTypeResource[];
|
||||
}
|
||||
interface EndUserTypeResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
machine_name: string;
|
||||
fields: Array<any>;
|
||||
url: string;
|
||||
}
|
||||
export declare class EndUserTypeInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: EndUserTypeContextSolution;
|
||||
protected _context?: EndUserTypeContext;
|
||||
constructor(_version: V2, payload: EndUserTypeResource, sid?: string);
|
||||
/**
|
||||
* The unique string that identifies the End-User Type resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc.
|
||||
*/
|
||||
machineName: string;
|
||||
/**
|
||||
* The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals.
|
||||
*/
|
||||
fields: Array<any>;
|
||||
/**
|
||||
* The absolute URL of the End-User Type resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise<EndUserTypeInstance>;
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EndUserTypeInstance>) => any): Promise<ApiResponse<EndUserTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
machineName: string;
|
||||
fields: any[];
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface EndUserTypeSolution {
|
||||
}
|
||||
export interface EndUserTypeListInstance {
|
||||
_version: V2;
|
||||
_solution: EndUserTypeSolution;
|
||||
_uri: string;
|
||||
(sid: string): EndUserTypeContext;
|
||||
get(sid: string): EndUserTypeContext;
|
||||
/**
|
||||
* Streams EndUserTypeInstance 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 { EndUserTypeListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: EndUserTypeListInstanceEachOptions, callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams EndUserTypeInstance 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 { EndUserTypeListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: EndUserTypeListInstanceEachOptions, callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of EndUserTypeInstance 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: EndUserTypePage) => any): Promise<EndUserTypePage>;
|
||||
/**
|
||||
* Retrieve a single target page of EndUserTypeInstance 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<EndUserTypePage>) => any): Promise<ApiResponse<EndUserTypePage>>;
|
||||
/**
|
||||
* Lists EndUserTypeInstance 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 { EndUserTypeListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise<EndUserTypeInstance[]>;
|
||||
list(params: EndUserTypeListInstanceOptions, callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise<EndUserTypeInstance[]>;
|
||||
/**
|
||||
* Lists EndUserTypeInstance 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 { EndUserTypeListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EndUserTypeInstance[]>) => any): Promise<ApiResponse<EndUserTypeInstance[]>>;
|
||||
listWithHttpInfo(params: EndUserTypeListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<EndUserTypeInstance[]>) => any): Promise<ApiResponse<EndUserTypeInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of EndUserTypeInstance 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 { EndUserTypeListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: EndUserTypePage) => any): Promise<EndUserTypePage>;
|
||||
page(params: EndUserTypeListInstancePageOptions, callback?: (error: Error | null, items: EndUserTypePage) => any): Promise<EndUserTypePage>;
|
||||
/**
|
||||
* Retrieve a single page of EndUserTypeInstance 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 { EndUserTypeListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<EndUserTypePage>) => any): Promise<ApiResponse<EndUserTypePage>>;
|
||||
pageWithHttpInfo(params: EndUserTypeListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<EndUserTypePage>) => any): Promise<ApiResponse<EndUserTypePage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function EndUserTypeListInstance(version: V2): EndUserTypeListInstance;
|
||||
export declare class EndUserTypePage extends Page<V2, EndUserTypePayload, EndUserTypeResource, EndUserTypeInstance> {
|
||||
/**
|
||||
* Initialize the EndUserTypePage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: EndUserTypeSolution);
|
||||
/**
|
||||
* Build an instance of EndUserTypeInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: EndUserTypeResource): EndUserTypeInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
260
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js
generated
vendored
Normal file
260
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js
generated
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.EndUserTypePage = exports.EndUserTypeInstance = exports.EndUserTypeContextImpl = void 0;
|
||||
exports.EndUserTypeListInstance = EndUserTypeListInstance;
|
||||
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 EndUserTypeContextImpl {
|
||||
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 = `/RegulatoryCompliance/EndUserTypes/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new EndUserTypeInstance(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 EndUserTypeInstance(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.EndUserTypeContextImpl = EndUserTypeContextImpl;
|
||||
class EndUserTypeInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.machineName = payload.machine_name;
|
||||
this.fields = payload.fields;
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new EndUserTypeContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a EndUserTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed EndUserTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
machineName: this.machineName,
|
||||
fields: this.fields,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EndUserTypeInstance = EndUserTypeInstance;
|
||||
function EndUserTypeListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new EndUserTypeContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/EndUserTypes`;
|
||||
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 EndUserTypePage(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 EndUserTypePage(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 EndUserTypePage(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 EndUserTypePage(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 EndUserTypePage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the EndUserTypePage
|
||||
*
|
||||
* @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 EndUserTypeInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new EndUserTypeInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.EndUserTypePage = EndUserTypePage;
|
||||
360
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts
generated
vendored
Normal file
360
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,360 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* The type of End User the regulation requires - can be `individual` or `business`.
|
||||
*/
|
||||
export type RegulationEndUserType = "individual" | "business";
|
||||
/**
|
||||
* Options to pass to fetch a RegulationInstance
|
||||
*/
|
||||
export interface RegulationContextFetchOptions {
|
||||
/** A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields */
|
||||
includeConstraints?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface RegulationListInstanceEachOptions {
|
||||
/** The type of End User the regulation requires - can be `individual` or `business`. */
|
||||
endUserType?: RegulationEndUserType;
|
||||
/** The ISO country code of the phone number\'s country. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number that the regulatory requiremnt is restricting. */
|
||||
numberType?: string;
|
||||
/** A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields */
|
||||
includeConstraints?: 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: RegulationInstance, 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 RegulationListInstanceOptions {
|
||||
/** The type of End User the regulation requires - can be `individual` or `business`. */
|
||||
endUserType?: RegulationEndUserType;
|
||||
/** The ISO country code of the phone number\'s country. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number that the regulatory requiremnt is restricting. */
|
||||
numberType?: string;
|
||||
/** A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields */
|
||||
includeConstraints?: 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 RegulationListInstancePageOptions {
|
||||
/** The type of End User the regulation requires - can be `individual` or `business`. */
|
||||
endUserType?: RegulationEndUserType;
|
||||
/** The ISO country code of the phone number\'s country. */
|
||||
isoCountry?: string;
|
||||
/** The type of phone number that the regulatory requiremnt is restricting. */
|
||||
numberType?: string;
|
||||
/** A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields */
|
||||
includeConstraints?: 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 RegulationContext {
|
||||
/**
|
||||
* Fetch a RegulationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RegulationInstance) => any): Promise<RegulationInstance>;
|
||||
/**
|
||||
* Fetch a RegulationInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance
|
||||
*/
|
||||
fetch(params: RegulationContextFetchOptions, callback?: (error: Error | null, item?: RegulationInstance) => any): Promise<RegulationInstance>;
|
||||
/**
|
||||
* Fetch a RegulationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RegulationInstance>) => any): Promise<ApiResponse<RegulationInstance>>;
|
||||
/**
|
||||
* Fetch a RegulationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: RegulationContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<RegulationInstance>) => any): Promise<ApiResponse<RegulationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface RegulationContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class RegulationContextImpl implements RegulationContext {
|
||||
protected _version: V2;
|
||||
protected _solution: RegulationContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, sid: string);
|
||||
fetch(params?: RegulationContextFetchOptions | ((error: Error | null, item?: RegulationInstance) => any), callback?: (error: Error | null, item?: RegulationInstance) => any): Promise<RegulationInstance>;
|
||||
fetchWithHttpInfo(params?: RegulationContextFetchOptions | ((error: Error | null, item?: ApiResponse<RegulationInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<RegulationInstance>) => any): Promise<ApiResponse<RegulationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): RegulationContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface RegulationPayload extends TwilioResponsePayload {
|
||||
results: RegulationResource[];
|
||||
}
|
||||
interface RegulationResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
iso_country: string;
|
||||
number_type: string;
|
||||
end_user_type: RegulationEndUserType;
|
||||
requirements: any;
|
||||
url: string;
|
||||
}
|
||||
export declare class RegulationInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: RegulationContextSolution;
|
||||
protected _context?: RegulationContext;
|
||||
constructor(_version: V2, payload: RegulationResource, sid?: string);
|
||||
/**
|
||||
* The unique string that identifies the Regulation resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The ISO country code of the phone number\'s country.
|
||||
*/
|
||||
isoCountry: string;
|
||||
/**
|
||||
* The type of phone number restricted by the regulatory requirement. For example, Germany mobile phone numbers provisioned by businesses require a business name with commercial register proof from the Handelsregisterauszug and a proof of address from Handelsregisterauszug or a trade license by Gewerbeanmeldung.
|
||||
*/
|
||||
numberType: string;
|
||||
endUserType: RegulationEndUserType;
|
||||
/**
|
||||
* The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type.
|
||||
*/
|
||||
requirements: any;
|
||||
/**
|
||||
* The absolute URL of the Regulation resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a RegulationInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RegulationInstance) => any): Promise<RegulationInstance>;
|
||||
/**
|
||||
* Fetch a RegulationInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance
|
||||
*/
|
||||
fetch(params: RegulationContextFetchOptions, callback?: (error: Error | null, item?: RegulationInstance) => any): Promise<RegulationInstance>;
|
||||
/**
|
||||
* Fetch a RegulationInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RegulationInstance>) => any): Promise<ApiResponse<RegulationInstance>>;
|
||||
/**
|
||||
* Fetch a RegulationInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RegulationInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: RegulationContextFetchOptions, callback?: (error: Error | null, item?: ApiResponse<RegulationInstance>) => any): Promise<ApiResponse<RegulationInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
isoCountry: string;
|
||||
numberType: string;
|
||||
endUserType: RegulationEndUserType;
|
||||
requirements: any;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface RegulationSolution {
|
||||
}
|
||||
export interface RegulationListInstance {
|
||||
_version: V2;
|
||||
_solution: RegulationSolution;
|
||||
_uri: string;
|
||||
(sid: string): RegulationContext;
|
||||
get(sid: string): RegulationContext;
|
||||
/**
|
||||
* Streams RegulationInstance 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 { RegulationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: RegulationListInstanceEachOptions, callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams RegulationInstance 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 { RegulationListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: RegulationListInstanceEachOptions, callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of RegulationInstance 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: RegulationPage) => any): Promise<RegulationPage>;
|
||||
/**
|
||||
* Retrieve a single target page of RegulationInstance 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<RegulationPage>) => any): Promise<ApiResponse<RegulationPage>>;
|
||||
/**
|
||||
* Lists RegulationInstance 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 { RegulationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: RegulationInstance[]) => any): Promise<RegulationInstance[]>;
|
||||
list(params: RegulationListInstanceOptions, callback?: (error: Error | null, items: RegulationInstance[]) => any): Promise<RegulationInstance[]>;
|
||||
/**
|
||||
* Lists RegulationInstance 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 { RegulationListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RegulationInstance[]>) => any): Promise<ApiResponse<RegulationInstance[]>>;
|
||||
listWithHttpInfo(params: RegulationListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RegulationInstance[]>) => any): Promise<ApiResponse<RegulationInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of RegulationInstance 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 { RegulationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: RegulationPage) => any): Promise<RegulationPage>;
|
||||
page(params: RegulationListInstancePageOptions, callback?: (error: Error | null, items: RegulationPage) => any): Promise<RegulationPage>;
|
||||
/**
|
||||
* Retrieve a single page of RegulationInstance 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 { RegulationListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RegulationPage>) => any): Promise<ApiResponse<RegulationPage>>;
|
||||
pageWithHttpInfo(params: RegulationListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RegulationPage>) => any): Promise<ApiResponse<RegulationPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RegulationListInstance(version: V2): RegulationListInstance;
|
||||
export declare class RegulationPage extends Page<V2, RegulationPayload, RegulationResource, RegulationInstance> {
|
||||
/**
|
||||
* Initialize the RegulationPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: RegulationSolution);
|
||||
/**
|
||||
* Build an instance of RegulationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: RegulationResource): RegulationInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
288
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js
generated
vendored
Normal file
288
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js
generated
vendored
Normal file
@@ -0,0 +1,288 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.RegulationPage = exports.RegulationInstance = exports.RegulationContextImpl = void 0;
|
||||
exports.RegulationListInstance = RegulationListInstance;
|
||||
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 RegulationContextImpl {
|
||||
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 = `/RegulatoryCompliance/Regulations/${sid}`;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["includeConstraints"] !== undefined)
|
||||
data["IncludeConstraints"] = serialize.bool(params["includeConstraints"]);
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RegulationInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["includeConstraints"] !== undefined)
|
||||
data["IncludeConstraints"] = serialize.bool(params["includeConstraints"]);
|
||||
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",
|
||||
params: data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RegulationInstance(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.RegulationContextImpl = RegulationContextImpl;
|
||||
class RegulationInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.isoCountry = payload.iso_country;
|
||||
this.numberType = payload.number_type;
|
||||
this.endUserType = payload.end_user_type;
|
||||
this.requirements = payload.requirements;
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new RegulationContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
fetch(params, callback) {
|
||||
return this._proxy.fetch(params, callback);
|
||||
}
|
||||
fetchWithHttpInfo(params, callback) {
|
||||
return this._proxy.fetchWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
isoCountry: this.isoCountry,
|
||||
numberType: this.numberType,
|
||||
endUserType: this.endUserType,
|
||||
requirements: this.requirements,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RegulationInstance = RegulationInstance;
|
||||
function RegulationListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new RegulationContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/Regulations`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["includeConstraints"] !== undefined)
|
||||
data["IncludeConstraints"] = serialize.bool(params["includeConstraints"]);
|
||||
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 RegulationPage(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 RegulationPage(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["endUserType"] !== undefined)
|
||||
data["EndUserType"] = params["endUserType"];
|
||||
if (params["isoCountry"] !== undefined)
|
||||
data["IsoCountry"] = params["isoCountry"];
|
||||
if (params["numberType"] !== undefined)
|
||||
data["NumberType"] = params["numberType"];
|
||||
if (params["includeConstraints"] !== undefined)
|
||||
data["IncludeConstraints"] = serialize.bool(params["includeConstraints"]);
|
||||
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 RegulationPage(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 RegulationPage(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 RegulationPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the RegulationPage
|
||||
*
|
||||
* @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 RegulationInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new RegulationInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RegulationPage = RegulationPage;
|
||||
465
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts
generated
vendored
Normal file
465
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts
generated
vendored
Normal file
@@ -0,0 +1,465 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* The verification status of the Supporting Document resource.
|
||||
*/
|
||||
export type SupportingDocumentStatus = "draft" | "pending-review" | "rejected" | "approved" | "expired" | "provisionally-approved";
|
||||
/**
|
||||
* Options to pass to update a SupportingDocumentInstance
|
||||
*/
|
||||
export interface SupportingDocumentContextUpdateOptions {
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName?: string;
|
||||
/** The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */
|
||||
attributes?: any;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a SupportingDocumentInstance
|
||||
*/
|
||||
export interface SupportingDocumentListInstanceCreateOptions {
|
||||
/** The string that you assigned to describe the resource. */
|
||||
friendlyName: string;
|
||||
/** The type of the Supporting Document. */
|
||||
type: string;
|
||||
/** The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. */
|
||||
attributes?: any;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface SupportingDocumentListInstanceEachOptions {
|
||||
/** 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: SupportingDocumentInstance, 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 SupportingDocumentListInstanceOptions {
|
||||
/** 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 SupportingDocumentListInstancePageOptions {
|
||||
/** 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 SupportingDocumentContext {
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance 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 SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Fetch a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface SupportingDocumentContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class SupportingDocumentContextImpl implements SupportingDocumentContext {
|
||||
protected _version: V2;
|
||||
protected _solution: SupportingDocumentContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, 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?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
update(params?: SupportingDocumentContextUpdateOptions | ((error: Error | null, item?: SupportingDocumentInstance) => any), callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
updateWithHttpInfo(params?: SupportingDocumentContextUpdateOptions | ((error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): SupportingDocumentContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface SupportingDocumentPayload extends TwilioResponsePayload {
|
||||
results: SupportingDocumentResource[];
|
||||
}
|
||||
interface SupportingDocumentResource {
|
||||
sid: string;
|
||||
account_sid: string;
|
||||
friendly_name: string;
|
||||
mime_type: string;
|
||||
status: SupportingDocumentStatus;
|
||||
failure_reason: string;
|
||||
errors: Array<any>;
|
||||
type: string;
|
||||
attributes: any;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class SupportingDocumentInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: SupportingDocumentContextSolution;
|
||||
protected _context?: SupportingDocumentContext;
|
||||
constructor(_version: V2, payload: SupportingDocumentResource, sid?: string);
|
||||
/**
|
||||
* The unique string created by Twilio to identify the Supporting Document resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The image type uploaded in the Supporting Document container.
|
||||
*/
|
||||
mimeType: string;
|
||||
status: SupportingDocumentStatus;
|
||||
/**
|
||||
* The failure reason of the Supporting Document Resource.
|
||||
*/
|
||||
failureReason: string;
|
||||
/**
|
||||
* A list of errors that occurred during the registering RC Bundle
|
||||
*/
|
||||
errors: Array<any>;
|
||||
/**
|
||||
* The type of the Supporting Document.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types.
|
||||
*/
|
||||
attributes: any;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the Supporting Document resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance 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 SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Fetch a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Update a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
friendlyName: string;
|
||||
mimeType: string;
|
||||
status: SupportingDocumentStatus;
|
||||
failureReason: string;
|
||||
errors: any[];
|
||||
type: string;
|
||||
attributes: any;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface SupportingDocumentSolution {
|
||||
}
|
||||
export interface SupportingDocumentListInstance {
|
||||
_version: V2;
|
||||
_solution: SupportingDocumentSolution;
|
||||
_uri: string;
|
||||
(sid: string): SupportingDocumentContext;
|
||||
get(sid: string): SupportingDocumentContext;
|
||||
/**
|
||||
* Create a SupportingDocumentInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
create(params: SupportingDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise<SupportingDocumentInstance>;
|
||||
/**
|
||||
* Create a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: SupportingDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentInstance>) => any): Promise<ApiResponse<SupportingDocumentInstance>>;
|
||||
/**
|
||||
* Streams SupportingDocumentInstance 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 { SupportingDocumentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: SupportingDocumentListInstanceEachOptions, callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams SupportingDocumentInstance 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 { SupportingDocumentListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: SupportingDocumentListInstanceEachOptions, callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of SupportingDocumentInstance 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: SupportingDocumentPage) => any): Promise<SupportingDocumentPage>;
|
||||
/**
|
||||
* Retrieve a single target page of SupportingDocumentInstance 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<SupportingDocumentPage>) => any): Promise<ApiResponse<SupportingDocumentPage>>;
|
||||
/**
|
||||
* Lists SupportingDocumentInstance 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 { SupportingDocumentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise<SupportingDocumentInstance[]>;
|
||||
list(params: SupportingDocumentListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise<SupportingDocumentInstance[]>;
|
||||
/**
|
||||
* Lists SupportingDocumentInstance 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 { SupportingDocumentListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SupportingDocumentInstance[]>) => any): Promise<ApiResponse<SupportingDocumentInstance[]>>;
|
||||
listWithHttpInfo(params: SupportingDocumentListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<SupportingDocumentInstance[]>) => any): Promise<ApiResponse<SupportingDocumentInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of SupportingDocumentInstance 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 { SupportingDocumentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise<SupportingDocumentPage>;
|
||||
page(params: SupportingDocumentListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise<SupportingDocumentPage>;
|
||||
/**
|
||||
* Retrieve a single page of SupportingDocumentInstance 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 { SupportingDocumentListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SupportingDocumentPage>) => any): Promise<ApiResponse<SupportingDocumentPage>>;
|
||||
pageWithHttpInfo(params: SupportingDocumentListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<SupportingDocumentPage>) => any): Promise<ApiResponse<SupportingDocumentPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SupportingDocumentListInstance(version: V2): SupportingDocumentListInstance;
|
||||
export declare class SupportingDocumentPage extends Page<V2, SupportingDocumentPayload, SupportingDocumentResource, SupportingDocumentInstance> {
|
||||
/**
|
||||
* Initialize the SupportingDocumentPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: SupportingDocumentSolution);
|
||||
/**
|
||||
* Build an instance of SupportingDocumentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: SupportingDocumentResource): SupportingDocumentInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
449
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js
generated
vendored
Normal file
449
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js
generated
vendored
Normal file
@@ -0,0 +1,449 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.SupportingDocumentPage = exports.SupportingDocumentInstance = exports.SupportingDocumentContextImpl = void 0;
|
||||
exports.SupportingDocumentListInstance = SupportingDocumentListInstance;
|
||||
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 SupportingDocumentContextImpl {
|
||||
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 = `/RegulatoryCompliance/SupportingDocuments/${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 SupportingDocumentInstance(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 SupportingDocumentInstance(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["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 SupportingDocumentInstance(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["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 SupportingDocumentInstance(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.SupportingDocumentContextImpl = SupportingDocumentContextImpl;
|
||||
class SupportingDocumentInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.mimeType = payload.mime_type;
|
||||
this.status = payload.status;
|
||||
this.failureReason = payload.failure_reason;
|
||||
this.errors = payload.errors;
|
||||
this.type = payload.type;
|
||||
this.attributes = payload.attributes;
|
||||
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 SupportingDocumentContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a SupportingDocumentInstance 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 SupportingDocumentInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a SupportingDocumentInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentInstance 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,
|
||||
accountSid: this.accountSid,
|
||||
friendlyName: this.friendlyName,
|
||||
mimeType: this.mimeType,
|
||||
status: this.status,
|
||||
failureReason: this.failureReason,
|
||||
errors: this.errors,
|
||||
type: this.type,
|
||||
attributes: this.attributes,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SupportingDocumentInstance = SupportingDocumentInstance;
|
||||
function SupportingDocumentListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new SupportingDocumentContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/SupportingDocuments`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["type"] === null || params["type"] === undefined) {
|
||||
throw new Error("Required parameter \"params['type']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Type"] = params["type"];
|
||||
if (params["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 SupportingDocumentInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
if (params["type"] === null || params["type"] === undefined) {
|
||||
throw new Error("Required parameter \"params['type']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
data["Type"] = params["type"];
|
||||
if (params["attributes"] !== undefined)
|
||||
data["Attributes"] = serialize.object(params["attributes"]);
|
||||
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 SupportingDocumentInstance(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 SupportingDocumentPage(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 SupportingDocumentPage(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 SupportingDocumentPage(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 SupportingDocumentPage(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 SupportingDocumentPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the SupportingDocumentPage
|
||||
*
|
||||
* @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 SupportingDocumentInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new SupportingDocumentInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SupportingDocumentPage = SupportingDocumentPage;
|
||||
280
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts
generated
vendored
Normal file
280
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V2 from "../../V2";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface SupportingDocumentTypeListInstanceEachOptions {
|
||||
/** 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: SupportingDocumentTypeInstance, 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 SupportingDocumentTypeListInstanceOptions {
|
||||
/** 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 SupportingDocumentTypeListInstancePageOptions {
|
||||
/** 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 SupportingDocumentTypeContext {
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise<SupportingDocumentTypeInstance>;
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentTypeInstance>) => any): Promise<ApiResponse<SupportingDocumentTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface SupportingDocumentTypeContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class SupportingDocumentTypeContextImpl implements SupportingDocumentTypeContext {
|
||||
protected _version: V2;
|
||||
protected _solution: SupportingDocumentTypeContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V2, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise<SupportingDocumentTypeInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentTypeInstance>) => any): Promise<ApiResponse<SupportingDocumentTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): SupportingDocumentTypeContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface SupportingDocumentTypePayload extends TwilioResponsePayload {
|
||||
supporting_document_types: SupportingDocumentTypeResource[];
|
||||
}
|
||||
interface SupportingDocumentTypeResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
machine_name: string;
|
||||
fields: Array<any>;
|
||||
url: string;
|
||||
}
|
||||
export declare class SupportingDocumentTypeInstance {
|
||||
protected _version: V2;
|
||||
protected _solution: SupportingDocumentTypeContextSolution;
|
||||
protected _context?: SupportingDocumentTypeContext;
|
||||
constructor(_version: V2, payload: SupportingDocumentTypeResource, sid?: string);
|
||||
/**
|
||||
* The unique string that identifies the Supporting Document Type resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A human-readable description of the Supporting Document Type resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The machine-readable description of the Supporting Document Type resource.
|
||||
*/
|
||||
machineName: string;
|
||||
/**
|
||||
* The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals.
|
||||
*/
|
||||
fields: Array<any>;
|
||||
/**
|
||||
* The absolute URL of the Supporting Document Type resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise<SupportingDocumentTypeInstance>;
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SupportingDocumentTypeInstance>) => any): Promise<ApiResponse<SupportingDocumentTypeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
machineName: string;
|
||||
fields: any[];
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface SupportingDocumentTypeSolution {
|
||||
}
|
||||
export interface SupportingDocumentTypeListInstance {
|
||||
_version: V2;
|
||||
_solution: SupportingDocumentTypeSolution;
|
||||
_uri: string;
|
||||
(sid: string): SupportingDocumentTypeContext;
|
||||
get(sid: string): SupportingDocumentTypeContext;
|
||||
/**
|
||||
* Streams SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: SupportingDocumentTypeListInstanceEachOptions, callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: SupportingDocumentTypeListInstanceEachOptions, callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of SupportingDocumentTypeInstance 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: SupportingDocumentTypePage) => any): Promise<SupportingDocumentTypePage>;
|
||||
/**
|
||||
* Retrieve a single target page of SupportingDocumentTypeInstance 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<SupportingDocumentTypePage>) => any): Promise<ApiResponse<SupportingDocumentTypePage>>;
|
||||
/**
|
||||
* Lists SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise<SupportingDocumentTypeInstance[]>;
|
||||
list(params: SupportingDocumentTypeListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise<SupportingDocumentTypeInstance[]>;
|
||||
/**
|
||||
* Lists SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SupportingDocumentTypeInstance[]>) => any): Promise<ApiResponse<SupportingDocumentTypeInstance[]>>;
|
||||
listWithHttpInfo(params: SupportingDocumentTypeListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<SupportingDocumentTypeInstance[]>) => any): Promise<ApiResponse<SupportingDocumentTypeInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise<SupportingDocumentTypePage>;
|
||||
page(params: SupportingDocumentTypeListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise<SupportingDocumentTypePage>;
|
||||
/**
|
||||
* Retrieve a single page of SupportingDocumentTypeInstance 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 { SupportingDocumentTypeListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SupportingDocumentTypePage>) => any): Promise<ApiResponse<SupportingDocumentTypePage>>;
|
||||
pageWithHttpInfo(params: SupportingDocumentTypeListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<SupportingDocumentTypePage>) => any): Promise<ApiResponse<SupportingDocumentTypePage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SupportingDocumentTypeListInstance(version: V2): SupportingDocumentTypeListInstance;
|
||||
export declare class SupportingDocumentTypePage extends Page<V2, SupportingDocumentTypePayload, SupportingDocumentTypeResource, SupportingDocumentTypeInstance> {
|
||||
/**
|
||||
* Initialize the SupportingDocumentTypePage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V2, response: Response<string>, solution: SupportingDocumentTypeSolution);
|
||||
/**
|
||||
* Build an instance of SupportingDocumentTypeInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: SupportingDocumentTypeResource): SupportingDocumentTypeInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
260
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js
generated
vendored
Normal file
260
node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js
generated
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.SupportingDocumentTypePage = exports.SupportingDocumentTypeInstance = exports.SupportingDocumentTypeContextImpl = void 0;
|
||||
exports.SupportingDocumentTypeListInstance = SupportingDocumentTypeListInstance;
|
||||
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 SupportingDocumentTypeContextImpl {
|
||||
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 = `/RegulatoryCompliance/SupportingDocumentTypes/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SupportingDocumentTypeInstance(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 SupportingDocumentTypeInstance(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.SupportingDocumentTypeContextImpl = SupportingDocumentTypeContextImpl;
|
||||
class SupportingDocumentTypeInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.machineName = payload.machine_name;
|
||||
this.fields = payload.fields;
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new SupportingDocumentTypeContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a SupportingDocumentTypeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SupportingDocumentTypeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
machineName: this.machineName,
|
||||
fields: this.fields,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SupportingDocumentTypeInstance = SupportingDocumentTypeInstance;
|
||||
function SupportingDocumentTypeListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new SupportingDocumentTypeContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/RegulatoryCompliance/SupportingDocumentTypes`;
|
||||
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 SupportingDocumentTypePage(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 SupportingDocumentTypePage(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 SupportingDocumentTypePage(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 SupportingDocumentTypePage(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 SupportingDocumentTypePage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the SupportingDocumentTypePage
|
||||
*
|
||||
* @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 SupportingDocumentTypeInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new SupportingDocumentTypeInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SupportingDocumentTypePage = SupportingDocumentTypePage;
|
||||
220
node_modules/twilio/lib/rest/numbers/v3/hostedNumberOrder.d.ts
generated
vendored
Normal file
220
node_modules/twilio/lib/rest/numbers/v3/hostedNumberOrder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V3 from "../V3";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
import { PhoneNumberCapabilities } from "../../../interfaces";
|
||||
export type HostedNumberOrderStatus = "twilio-processing" | "received" | "pending-verification" | "verified" | "pending-loa" | "carrier-processing" | "testing" | "completed" | "failed" | "action-required";
|
||||
export type HostedNumberOrderVerificationType = "phone-call" | "phone-bill";
|
||||
/**
|
||||
* Options to pass to create a HostedNumberOrderInstance
|
||||
*/
|
||||
export interface HostedNumberOrderListInstanceCreateOptions {
|
||||
/** The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format */
|
||||
phoneNumber: string;
|
||||
/** Used to specify that the SMS capability will be hosted on Twilio\\\'s platform. */
|
||||
smsCapability: boolean;
|
||||
/** This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. */
|
||||
accountSid?: string;
|
||||
/** A 64 character string that is a human readable text that describes this resource. */
|
||||
friendlyName?: string;
|
||||
/** Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */
|
||||
uniqueName?: string;
|
||||
/** Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. */
|
||||
ccEmails?: Array<string>;
|
||||
/** The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsUrl?: string;
|
||||
/** The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsMethod?: string;
|
||||
/** A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsFallbackUrl?: string;
|
||||
/** The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
||||
smsFallbackMethod?: string;
|
||||
/** Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. */
|
||||
statusCallbackUrl?: string;
|
||||
/** Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. */
|
||||
smsApplicationSid?: string;
|
||||
/** Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. */
|
||||
addressSid?: string;
|
||||
/** Optional. Email of the owner of this phone number that is being hosted. */
|
||||
email?: string;
|
||||
/** */
|
||||
verificationType?: HostedNumberOrderVerificationType;
|
||||
/** Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. */
|
||||
verificationDocumentSid?: string;
|
||||
}
|
||||
export interface HostedNumberOrderSolution {
|
||||
}
|
||||
export interface HostedNumberOrderListInstance {
|
||||
_version: V3;
|
||||
_solution: HostedNumberOrderSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a HostedNumberOrderInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance
|
||||
*/
|
||||
create(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
||||
/**
|
||||
* Create a HostedNumberOrderInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed HostedNumberOrderInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<HostedNumberOrderInstance>) => any): Promise<ApiResponse<HostedNumberOrderInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function HostedNumberOrderListInstance(version: V3): HostedNumberOrderListInstance;
|
||||
interface HostedNumberOrderResource {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
incomingPhoneNumberSid: string;
|
||||
addressSid: string;
|
||||
signingDocumentSid: string;
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendlyName: string;
|
||||
uniqueName: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
failureReason: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
verificationAttempts: number;
|
||||
email: string;
|
||||
ccEmails: Array<string>;
|
||||
url: string;
|
||||
verificationType: HostedNumberOrderVerificationType;
|
||||
verificationDocumentSid: string;
|
||||
extension: string;
|
||||
callDelay: number;
|
||||
verificationCode: string;
|
||||
verificationCallSids: Array<string>;
|
||||
}
|
||||
export declare class HostedNumberOrderInstance {
|
||||
protected _version: V3;
|
||||
constructor(_version: V3, payload: HostedNumberOrderResource);
|
||||
/**
|
||||
* A 34 character string that uniquely identifies this HostedNumberOrder.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the account.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted.
|
||||
*/
|
||||
incomingPhoneNumberSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
|
||||
*/
|
||||
addressSid: string;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign.
|
||||
*/
|
||||
signingDocumentSid: string;
|
||||
/**
|
||||
* Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212
|
||||
*/
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
/**
|
||||
* A 64 character string that is a human-readable text that describes this resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
|
||||
*/
|
||||
uniqueName: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
/**
|
||||
* A message that explains why a hosted_number_order went to status \"action-required\"
|
||||
*/
|
||||
failureReason: string;
|
||||
/**
|
||||
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The number of attempts made to verify ownership of the phone number that is being hosted.
|
||||
*/
|
||||
verificationAttempts: number;
|
||||
/**
|
||||
* Email of the owner of this phone number that is being hosted.
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.
|
||||
*/
|
||||
ccEmails: Array<string>;
|
||||
/**
|
||||
* The URL of this HostedNumberOrder.
|
||||
*/
|
||||
url: string;
|
||||
verificationType: HostedNumberOrderVerificationType;
|
||||
/**
|
||||
* A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.
|
||||
*/
|
||||
verificationDocumentSid: string;
|
||||
/**
|
||||
* A numerical extension to be used when making the ownership verification call.
|
||||
*/
|
||||
extension: string;
|
||||
/**
|
||||
* A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.
|
||||
*/
|
||||
callDelay: number;
|
||||
/**
|
||||
* A verification code provided in the response for a user to enter when they pick up the phone call.
|
||||
*/
|
||||
verificationCode: string;
|
||||
/**
|
||||
* A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.
|
||||
*/
|
||||
verificationCallSids: Array<string>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
accountSid: string;
|
||||
incomingPhoneNumberSid: string;
|
||||
addressSid: string;
|
||||
signingDocumentSid: string;
|
||||
phoneNumber: string;
|
||||
capabilities: PhoneNumberCapabilities;
|
||||
friendlyName: string;
|
||||
uniqueName: string;
|
||||
status: HostedNumberOrderStatus;
|
||||
failureReason: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
verificationAttempts: number;
|
||||
email: string;
|
||||
ccEmails: string[];
|
||||
url: string;
|
||||
verificationType: HostedNumberOrderVerificationType;
|
||||
verificationDocumentSid: string;
|
||||
extension: string;
|
||||
callDelay: number;
|
||||
verificationCode: string;
|
||||
verificationCallSids: string[];
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
217
node_modules/twilio/lib/rest/numbers/v3/hostedNumberOrder.js
generated
vendored
Normal file
217
node_modules/twilio/lib/rest/numbers/v3/hostedNumberOrder.js
generated
vendored
Normal file
@@ -0,0 +1,217 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Numbers
|
||||
* 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.HostedNumberOrderInstance = void 0;
|
||||
exports.HostedNumberOrderListInstance = HostedNumberOrderListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function HostedNumberOrderListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/HostedNumbers/HostedNumberOrders`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['phoneNumber']\" missing.");
|
||||
}
|
||||
if (params["smsCapability"] === null ||
|
||||
params["smsCapability"] === undefined) {
|
||||
throw new Error("Required parameter \"params['smsCapability']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["phoneNumber"] = params["phoneNumber"];
|
||||
data["smsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["accountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["friendlyName"] = params["friendlyName"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["uniqueName"] = params["uniqueName"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["ccEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
if (params["smsUrl"] !== undefined)
|
||||
data["smsUrl"] = params["smsUrl"];
|
||||
if (params["smsMethod"] !== undefined)
|
||||
data["smsMethod"] = params["smsMethod"];
|
||||
if (params["smsFallbackUrl"] !== undefined)
|
||||
data["smsFallbackUrl"] = params["smsFallbackUrl"];
|
||||
if (params["smsFallbackMethod"] !== undefined)
|
||||
data["smsFallbackMethod"] = params["smsFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["statusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["statusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["smsApplicationSid"] !== undefined)
|
||||
data["smsApplicationSid"] = params["smsApplicationSid"];
|
||||
if (params["addressSid"] !== undefined)
|
||||
data["addressSid"] = params["addressSid"];
|
||||
if (params["email"] !== undefined)
|
||||
data["email"] = params["email"];
|
||||
if (params["verificationType"] !== undefined)
|
||||
data["verificationType"] = params["verificationType"];
|
||||
if (params["verificationDocumentSid"] !== undefined)
|
||||
data["verificationDocumentSid"] = params["verificationDocumentSid"];
|
||||
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 HostedNumberOrderInstance(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["phoneNumber"] === null || params["phoneNumber"] === undefined) {
|
||||
throw new Error("Required parameter \"params['phoneNumber']\" missing.");
|
||||
}
|
||||
if (params["smsCapability"] === null ||
|
||||
params["smsCapability"] === undefined) {
|
||||
throw new Error("Required parameter \"params['smsCapability']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["phoneNumber"] = params["phoneNumber"];
|
||||
data["smsCapability"] = serialize.bool(params["smsCapability"]);
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["accountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["friendlyName"] = params["friendlyName"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["uniqueName"] = params["uniqueName"];
|
||||
if (params["ccEmails"] !== undefined)
|
||||
data["ccEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
||||
if (params["smsUrl"] !== undefined)
|
||||
data["smsUrl"] = params["smsUrl"];
|
||||
if (params["smsMethod"] !== undefined)
|
||||
data["smsMethod"] = params["smsMethod"];
|
||||
if (params["smsFallbackUrl"] !== undefined)
|
||||
data["smsFallbackUrl"] = params["smsFallbackUrl"];
|
||||
if (params["smsFallbackMethod"] !== undefined)
|
||||
data["smsFallbackMethod"] = params["smsFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["statusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["statusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["smsApplicationSid"] !== undefined)
|
||||
data["smsApplicationSid"] = params["smsApplicationSid"];
|
||||
if (params["addressSid"] !== undefined)
|
||||
data["addressSid"] = params["addressSid"];
|
||||
if (params["email"] !== undefined)
|
||||
data["email"] = params["email"];
|
||||
if (params["verificationType"] !== undefined)
|
||||
data["verificationType"] = params["verificationType"];
|
||||
if (params["verificationDocumentSid"] !== undefined)
|
||||
data["verificationDocumentSid"] = params["verificationDocumentSid"];
|
||||
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 HostedNumberOrderInstance(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 HostedNumberOrderInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.accountSid = payload.accountSid;
|
||||
this.incomingPhoneNumberSid = payload.incomingPhoneNumberSid;
|
||||
this.addressSid = payload.addressSid;
|
||||
this.signingDocumentSid = payload.signingDocumentSid;
|
||||
this.phoneNumber = payload.phoneNumber;
|
||||
this.capabilities = payload.capabilities;
|
||||
this.friendlyName = payload.friendlyName;
|
||||
this.uniqueName = payload.uniqueName;
|
||||
this.status = payload.status;
|
||||
this.failureReason = payload.failureReason;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.dateCreated);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.dateUpdated);
|
||||
this.verificationAttempts = deserialize.integer(payload.verificationAttempts);
|
||||
this.email = payload.email;
|
||||
this.ccEmails = payload.ccEmails;
|
||||
this.url = payload.url;
|
||||
this.verificationType = payload.verificationType;
|
||||
this.verificationDocumentSid = payload.verificationDocumentSid;
|
||||
this.extension = payload.extension;
|
||||
this.callDelay = deserialize.integer(payload.callDelay);
|
||||
this.verificationCode = payload.verificationCode;
|
||||
this.verificationCallSids = payload.verificationCallSids;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
accountSid: this.accountSid,
|
||||
incomingPhoneNumberSid: this.incomingPhoneNumberSid,
|
||||
addressSid: this.addressSid,
|
||||
signingDocumentSid: this.signingDocumentSid,
|
||||
phoneNumber: this.phoneNumber,
|
||||
capabilities: this.capabilities,
|
||||
friendlyName: this.friendlyName,
|
||||
uniqueName: this.uniqueName,
|
||||
status: this.status,
|
||||
failureReason: this.failureReason,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
verificationAttempts: this.verificationAttempts,
|
||||
email: this.email,
|
||||
ccEmails: this.ccEmails,
|
||||
url: this.url,
|
||||
verificationType: this.verificationType,
|
||||
verificationDocumentSid: this.verificationDocumentSid,
|
||||
extension: this.extension,
|
||||
callDelay: this.callDelay,
|
||||
verificationCode: this.verificationCode,
|
||||
verificationCallSids: this.verificationCallSids,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.HostedNumberOrderInstance = HostedNumberOrderInstance;
|
||||
Reference in New Issue
Block a user