twilio 4.11.2 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/BaseTwilio.js +15 -8
- package/lib/rest/api/v2010/account/message.d.ts +2 -2
- package/lib/rest/api/v2010/account/message.js +2 -2
- package/lib/rest/insights/v1/call/annotation.d.ts +9 -9
- package/lib/rest/insights/v1/call/callSummary.d.ts +58 -1
- package/lib/rest/insights/v1/call/event.d.ts +30 -3
- package/lib/rest/insights/v1/call/metric.d.ts +27 -6
- package/lib/rest/insights/v1/callSummaries.d.ts +135 -78
- package/lib/rest/insights/v1/callSummaries.js +8 -6
- package/lib/rest/insights/v1/setting.d.ts +16 -4
- package/lib/rest/lookups/v2/phoneNumber.d.ts +9 -1
- package/lib/rest/lookups/v2/phoneNumber.js +4 -0
- package/lib/rest/numbers/V1.d.ts +10 -0
- package/lib/rest/numbers/V1.js +15 -0
- package/lib/rest/numbers/V2.d.ts +10 -0
- package/lib/rest/numbers/V2.js +14 -0
- package/lib/rest/numbers/v1/portingBulkPortability.d.ts +120 -0
- package/lib/rest/numbers/v1/portingBulkPortability.js +136 -0
- package/lib/rest/numbers/v1/portingPortability.d.ts +134 -0
- package/lib/rest/numbers/v1/portingPortability.js +124 -0
- package/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts +265 -0
- package/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js +164 -0
- package/lib/rest/numbers/v2/authorizationDocument.d.ts +288 -0
- package/lib/rest/numbers/v2/authorizationDocument.js +257 -0
- package/lib/rest/numbers/v2/hostedNumberOrder.d.ts +390 -0
- package/lib/rest/numbers/v2/hostedNumberOrder.js +296 -0
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../V1";
|
|
4
|
+
export type PortingBulkPortabilityStatus = "in-progress" | "completed" | "expired";
|
|
5
|
+
/**
|
|
6
|
+
* Options to pass to create a PortingBulkPortabilityInstance
|
|
7
|
+
*/
|
|
8
|
+
export interface PortingBulkPortabilityListInstanceCreateOptions {
|
|
9
|
+
/** The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). . */
|
|
10
|
+
phoneNumbers: Array<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface PortingBulkPortabilityContext {
|
|
13
|
+
/**
|
|
14
|
+
* Fetch a PortingBulkPortabilityInstance
|
|
15
|
+
*
|
|
16
|
+
* @param callback - Callback to handle processed record
|
|
17
|
+
*
|
|
18
|
+
* @returns Resolves to processed PortingBulkPortabilityInstance
|
|
19
|
+
*/
|
|
20
|
+
fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise<PortingBulkPortabilityInstance>;
|
|
21
|
+
/**
|
|
22
|
+
* Provide a user-friendly representation
|
|
23
|
+
*/
|
|
24
|
+
toJSON(): any;
|
|
25
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
26
|
+
}
|
|
27
|
+
export interface PortingBulkPortabilityContextSolution {
|
|
28
|
+
sid: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class PortingBulkPortabilityContextImpl implements PortingBulkPortabilityContext {
|
|
31
|
+
protected _version: V1;
|
|
32
|
+
protected _solution: PortingBulkPortabilityContextSolution;
|
|
33
|
+
protected _uri: string;
|
|
34
|
+
constructor(_version: V1, sid: string);
|
|
35
|
+
fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise<PortingBulkPortabilityInstance>;
|
|
36
|
+
/**
|
|
37
|
+
* Provide a user-friendly representation
|
|
38
|
+
*
|
|
39
|
+
* @returns Object
|
|
40
|
+
*/
|
|
41
|
+
toJSON(): PortingBulkPortabilityContextSolution;
|
|
42
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
43
|
+
}
|
|
44
|
+
interface PortingBulkPortabilityResource {
|
|
45
|
+
sid: string;
|
|
46
|
+
status: PortingBulkPortabilityStatus;
|
|
47
|
+
datetime_created: Date;
|
|
48
|
+
phone_numbers: Array<any>;
|
|
49
|
+
url: string;
|
|
50
|
+
}
|
|
51
|
+
export declare class PortingBulkPortabilityInstance {
|
|
52
|
+
protected _version: V1;
|
|
53
|
+
protected _solution: PortingBulkPortabilityContextSolution;
|
|
54
|
+
protected _context?: PortingBulkPortabilityContext;
|
|
55
|
+
constructor(_version: V1, payload: PortingBulkPortabilityResource, sid?: string);
|
|
56
|
+
/**
|
|
57
|
+
* A 34 character string that uniquely identifies this Portability check.
|
|
58
|
+
*/
|
|
59
|
+
sid: string;
|
|
60
|
+
status: PortingBulkPortabilityStatus;
|
|
61
|
+
/**
|
|
62
|
+
* The date that the Portability check was created, given in ISO 8601 format.
|
|
63
|
+
*/
|
|
64
|
+
datetimeCreated: Date;
|
|
65
|
+
/**
|
|
66
|
+
* Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: `phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number.
|
|
67
|
+
*/
|
|
68
|
+
phoneNumbers: Array<any>;
|
|
69
|
+
/**
|
|
70
|
+
* This is the url of the request that you\'re trying to reach out to locate the resource.
|
|
71
|
+
*/
|
|
72
|
+
url: string;
|
|
73
|
+
private get _proxy();
|
|
74
|
+
/**
|
|
75
|
+
* Fetch a PortingBulkPortabilityInstance
|
|
76
|
+
*
|
|
77
|
+
* @param callback - Callback to handle processed record
|
|
78
|
+
*
|
|
79
|
+
* @returns Resolves to processed PortingBulkPortabilityInstance
|
|
80
|
+
*/
|
|
81
|
+
fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise<PortingBulkPortabilityInstance>;
|
|
82
|
+
/**
|
|
83
|
+
* Provide a user-friendly representation
|
|
84
|
+
*
|
|
85
|
+
* @returns Object
|
|
86
|
+
*/
|
|
87
|
+
toJSON(): {
|
|
88
|
+
sid: string;
|
|
89
|
+
status: PortingBulkPortabilityStatus;
|
|
90
|
+
datetimeCreated: Date;
|
|
91
|
+
phoneNumbers: any[];
|
|
92
|
+
url: string;
|
|
93
|
+
};
|
|
94
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
95
|
+
}
|
|
96
|
+
export interface PortingBulkPortabilitySolution {
|
|
97
|
+
}
|
|
98
|
+
export interface PortingBulkPortabilityListInstance {
|
|
99
|
+
_version: V1;
|
|
100
|
+
_solution: PortingBulkPortabilitySolution;
|
|
101
|
+
_uri: string;
|
|
102
|
+
(sid: string): PortingBulkPortabilityContext;
|
|
103
|
+
get(sid: string): PortingBulkPortabilityContext;
|
|
104
|
+
/**
|
|
105
|
+
* Create a PortingBulkPortabilityInstance
|
|
106
|
+
*
|
|
107
|
+
* @param params - Parameter for request
|
|
108
|
+
* @param callback - Callback to handle processed record
|
|
109
|
+
*
|
|
110
|
+
* @returns Resolves to processed PortingBulkPortabilityInstance
|
|
111
|
+
*/
|
|
112
|
+
create(params: PortingBulkPortabilityListInstanceCreateOptions, callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise<PortingBulkPortabilityInstance>;
|
|
113
|
+
/**
|
|
114
|
+
* Provide a user-friendly representation
|
|
115
|
+
*/
|
|
116
|
+
toJSON(): any;
|
|
117
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
118
|
+
}
|
|
119
|
+
export declare function PortingBulkPortabilityListInstance(version: V1): PortingBulkPortabilityListInstance;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Numbers
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.PortingBulkPortabilityListInstance = exports.PortingBulkPortabilityInstance = exports.PortingBulkPortabilityContextImpl = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../base/serialize");
|
|
20
|
+
const utility_1 = require("../../../base/utility");
|
|
21
|
+
class PortingBulkPortabilityContextImpl {
|
|
22
|
+
constructor(_version, sid) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
25
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
this._solution = { sid };
|
|
28
|
+
this._uri = `/Porting/Portability/${sid}`;
|
|
29
|
+
}
|
|
30
|
+
fetch(callback) {
|
|
31
|
+
const instance = this;
|
|
32
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
33
|
+
uri: instance._uri,
|
|
34
|
+
method: "get",
|
|
35
|
+
});
|
|
36
|
+
operationPromise = operationPromise.then((payload) => new PortingBulkPortabilityInstance(operationVersion, payload, instance._solution.sid));
|
|
37
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
38
|
+
return operationPromise;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provide a user-friendly representation
|
|
42
|
+
*
|
|
43
|
+
* @returns Object
|
|
44
|
+
*/
|
|
45
|
+
toJSON() {
|
|
46
|
+
return this._solution;
|
|
47
|
+
}
|
|
48
|
+
[util_1.inspect.custom](_depth, options) {
|
|
49
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PortingBulkPortabilityContextImpl = PortingBulkPortabilityContextImpl;
|
|
53
|
+
class PortingBulkPortabilityInstance {
|
|
54
|
+
constructor(_version, payload, sid) {
|
|
55
|
+
this._version = _version;
|
|
56
|
+
this.sid = payload.sid;
|
|
57
|
+
this.status = payload.status;
|
|
58
|
+
this.datetimeCreated = deserialize.iso8601DateTime(payload.datetime_created);
|
|
59
|
+
this.phoneNumbers = payload.phone_numbers;
|
|
60
|
+
this.url = payload.url;
|
|
61
|
+
this._solution = { sid: sid || this.sid };
|
|
62
|
+
}
|
|
63
|
+
get _proxy() {
|
|
64
|
+
this._context =
|
|
65
|
+
this._context ||
|
|
66
|
+
new PortingBulkPortabilityContextImpl(this._version, this._solution.sid);
|
|
67
|
+
return this._context;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Fetch a PortingBulkPortabilityInstance
|
|
71
|
+
*
|
|
72
|
+
* @param callback - Callback to handle processed record
|
|
73
|
+
*
|
|
74
|
+
* @returns Resolves to processed PortingBulkPortabilityInstance
|
|
75
|
+
*/
|
|
76
|
+
fetch(callback) {
|
|
77
|
+
return this._proxy.fetch(callback);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Provide a user-friendly representation
|
|
81
|
+
*
|
|
82
|
+
* @returns Object
|
|
83
|
+
*/
|
|
84
|
+
toJSON() {
|
|
85
|
+
return {
|
|
86
|
+
sid: this.sid,
|
|
87
|
+
status: this.status,
|
|
88
|
+
datetimeCreated: this.datetimeCreated,
|
|
89
|
+
phoneNumbers: this.phoneNumbers,
|
|
90
|
+
url: this.url,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
[util_1.inspect.custom](_depth, options) {
|
|
94
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.PortingBulkPortabilityInstance = PortingBulkPortabilityInstance;
|
|
98
|
+
function PortingBulkPortabilityListInstance(version) {
|
|
99
|
+
const instance = ((sid) => instance.get(sid));
|
|
100
|
+
instance.get = function get(sid) {
|
|
101
|
+
return new PortingBulkPortabilityContextImpl(version, sid);
|
|
102
|
+
};
|
|
103
|
+
instance._version = version;
|
|
104
|
+
instance._solution = {};
|
|
105
|
+
instance._uri = `/Porting/Portability`;
|
|
106
|
+
instance.create = function create(params, callback) {
|
|
107
|
+
if (params === null || params === undefined) {
|
|
108
|
+
throw new Error('Required parameter "params" missing.');
|
|
109
|
+
}
|
|
110
|
+
if (params["phoneNumbers"] === null ||
|
|
111
|
+
params["phoneNumbers"] === undefined) {
|
|
112
|
+
throw new Error("Required parameter \"params['phoneNumbers']\" missing.");
|
|
113
|
+
}
|
|
114
|
+
let data = {};
|
|
115
|
+
data["PhoneNumbers"] = serialize.map(params["phoneNumbers"], (e) => e);
|
|
116
|
+
const headers = {};
|
|
117
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
118
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
119
|
+
uri: instance._uri,
|
|
120
|
+
method: "post",
|
|
121
|
+
data,
|
|
122
|
+
headers,
|
|
123
|
+
});
|
|
124
|
+
operationPromise = operationPromise.then((payload) => new PortingBulkPortabilityInstance(operationVersion, payload));
|
|
125
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
126
|
+
return operationPromise;
|
|
127
|
+
};
|
|
128
|
+
instance.toJSON = function toJSON() {
|
|
129
|
+
return instance._solution;
|
|
130
|
+
};
|
|
131
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
132
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
133
|
+
};
|
|
134
|
+
return instance;
|
|
135
|
+
}
|
|
136
|
+
exports.PortingBulkPortabilityListInstance = PortingBulkPortabilityListInstance;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../V1";
|
|
4
|
+
export type PortingPortabilityNumberType = "LOCAL" | "UNKNOWN" | "MOBILE" | "TOLL-FREE";
|
|
5
|
+
export interface PortingPortabilityContext {
|
|
6
|
+
/**
|
|
7
|
+
* Fetch a PortingPortabilityInstance
|
|
8
|
+
*
|
|
9
|
+
* @param callback - Callback to handle processed record
|
|
10
|
+
*
|
|
11
|
+
* @returns Resolves to processed PortingPortabilityInstance
|
|
12
|
+
*/
|
|
13
|
+
fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
|
14
|
+
/**
|
|
15
|
+
* Provide a user-friendly representation
|
|
16
|
+
*/
|
|
17
|
+
toJSON(): any;
|
|
18
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
19
|
+
}
|
|
20
|
+
export interface PortingPortabilityContextSolution {
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class PortingPortabilityContextImpl implements PortingPortabilityContext {
|
|
24
|
+
protected _version: V1;
|
|
25
|
+
protected _solution: PortingPortabilityContextSolution;
|
|
26
|
+
protected _uri: string;
|
|
27
|
+
constructor(_version: V1, phoneNumber: string);
|
|
28
|
+
fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
|
29
|
+
/**
|
|
30
|
+
* Provide a user-friendly representation
|
|
31
|
+
*
|
|
32
|
+
* @returns Object
|
|
33
|
+
*/
|
|
34
|
+
toJSON(): PortingPortabilityContextSolution;
|
|
35
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
36
|
+
}
|
|
37
|
+
interface PortingPortabilityResource {
|
|
38
|
+
phone_number: string;
|
|
39
|
+
portable: boolean;
|
|
40
|
+
pin_and_account_number_required: boolean;
|
|
41
|
+
not_portable_reason: string;
|
|
42
|
+
not_portable_reason_code: number;
|
|
43
|
+
number_type: PortingPortabilityNumberType;
|
|
44
|
+
country: string;
|
|
45
|
+
messaging_carrier: string;
|
|
46
|
+
voice_carrier: string;
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
export declare class PortingPortabilityInstance {
|
|
50
|
+
protected _version: V1;
|
|
51
|
+
protected _solution: PortingPortabilityContextSolution;
|
|
52
|
+
protected _context?: PortingPortabilityContext;
|
|
53
|
+
constructor(_version: V1, payload: PortingPortabilityResource, phoneNumber?: string);
|
|
54
|
+
/**
|
|
55
|
+
* The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
|
|
56
|
+
*/
|
|
57
|
+
phoneNumber: string;
|
|
58
|
+
/**
|
|
59
|
+
* Boolean flag specifying if phone number is portable or not.
|
|
60
|
+
*/
|
|
61
|
+
portable: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Boolean flag specifying if PIN and account number is required for the phone number.
|
|
64
|
+
*/
|
|
65
|
+
pinAndAccountNumberRequired: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Reason why the phone number cannot be ported into Twilio, `null` otherwise.
|
|
68
|
+
*/
|
|
69
|
+
notPortableReason: string;
|
|
70
|
+
/**
|
|
71
|
+
* The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`.
|
|
72
|
+
*/
|
|
73
|
+
notPortableReasonCode: number;
|
|
74
|
+
numberType: PortingPortabilityNumberType;
|
|
75
|
+
/**
|
|
76
|
+
* Country the phone number belongs to.
|
|
77
|
+
*/
|
|
78
|
+
country: string;
|
|
79
|
+
/**
|
|
80
|
+
* Current messaging carrier of the phone number
|
|
81
|
+
*/
|
|
82
|
+
messagingCarrier: string;
|
|
83
|
+
/**
|
|
84
|
+
* Current voice carrier of the phone number
|
|
85
|
+
*/
|
|
86
|
+
voiceCarrier: string;
|
|
87
|
+
/**
|
|
88
|
+
* This is the url of the request that you\'re trying to reach out to locate the resource.
|
|
89
|
+
*/
|
|
90
|
+
url: string;
|
|
91
|
+
private get _proxy();
|
|
92
|
+
/**
|
|
93
|
+
* Fetch a PortingPortabilityInstance
|
|
94
|
+
*
|
|
95
|
+
* @param callback - Callback to handle processed record
|
|
96
|
+
*
|
|
97
|
+
* @returns Resolves to processed PortingPortabilityInstance
|
|
98
|
+
*/
|
|
99
|
+
fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise<PortingPortabilityInstance>;
|
|
100
|
+
/**
|
|
101
|
+
* Provide a user-friendly representation
|
|
102
|
+
*
|
|
103
|
+
* @returns Object
|
|
104
|
+
*/
|
|
105
|
+
toJSON(): {
|
|
106
|
+
phoneNumber: string;
|
|
107
|
+
portable: boolean;
|
|
108
|
+
pinAndAccountNumberRequired: boolean;
|
|
109
|
+
notPortableReason: string;
|
|
110
|
+
notPortableReasonCode: number;
|
|
111
|
+
numberType: PortingPortabilityNumberType;
|
|
112
|
+
country: string;
|
|
113
|
+
messagingCarrier: string;
|
|
114
|
+
voiceCarrier: string;
|
|
115
|
+
url: string;
|
|
116
|
+
};
|
|
117
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
118
|
+
}
|
|
119
|
+
export interface PortingPortabilitySolution {
|
|
120
|
+
}
|
|
121
|
+
export interface PortingPortabilityListInstance {
|
|
122
|
+
_version: V1;
|
|
123
|
+
_solution: PortingPortabilitySolution;
|
|
124
|
+
_uri: string;
|
|
125
|
+
(phoneNumber: string): PortingPortabilityContext;
|
|
126
|
+
get(phoneNumber: string): PortingPortabilityContext;
|
|
127
|
+
/**
|
|
128
|
+
* Provide a user-friendly representation
|
|
129
|
+
*/
|
|
130
|
+
toJSON(): any;
|
|
131
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
132
|
+
}
|
|
133
|
+
export declare function PortingPortabilityListInstance(version: V1): PortingPortabilityListInstance;
|
|
134
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Numbers
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.PortingPortabilityListInstance = exports.PortingPortabilityInstance = exports.PortingPortabilityContextImpl = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../base/serialize");
|
|
20
|
+
const utility_1 = require("../../../base/utility");
|
|
21
|
+
class PortingPortabilityContextImpl {
|
|
22
|
+
constructor(_version, phoneNumber) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(phoneNumber)) {
|
|
25
|
+
throw new Error("Parameter 'phoneNumber' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
this._solution = { phoneNumber };
|
|
28
|
+
this._uri = `/Porting/Portability/PhoneNumber/${phoneNumber}`;
|
|
29
|
+
}
|
|
30
|
+
fetch(callback) {
|
|
31
|
+
const instance = this;
|
|
32
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
33
|
+
uri: instance._uri,
|
|
34
|
+
method: "get",
|
|
35
|
+
});
|
|
36
|
+
operationPromise = operationPromise.then((payload) => new PortingPortabilityInstance(operationVersion, payload, instance._solution.phoneNumber));
|
|
37
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
38
|
+
return operationPromise;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provide a user-friendly representation
|
|
42
|
+
*
|
|
43
|
+
* @returns Object
|
|
44
|
+
*/
|
|
45
|
+
toJSON() {
|
|
46
|
+
return this._solution;
|
|
47
|
+
}
|
|
48
|
+
[util_1.inspect.custom](_depth, options) {
|
|
49
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PortingPortabilityContextImpl = PortingPortabilityContextImpl;
|
|
53
|
+
class PortingPortabilityInstance {
|
|
54
|
+
constructor(_version, payload, phoneNumber) {
|
|
55
|
+
this._version = _version;
|
|
56
|
+
this.phoneNumber = payload.phone_number;
|
|
57
|
+
this.portable = payload.portable;
|
|
58
|
+
this.pinAndAccountNumberRequired = payload.pin_and_account_number_required;
|
|
59
|
+
this.notPortableReason = payload.not_portable_reason;
|
|
60
|
+
this.notPortableReasonCode = deserialize.integer(payload.not_portable_reason_code);
|
|
61
|
+
this.numberType = payload.number_type;
|
|
62
|
+
this.country = payload.country;
|
|
63
|
+
this.messagingCarrier = payload.messaging_carrier;
|
|
64
|
+
this.voiceCarrier = payload.voice_carrier;
|
|
65
|
+
this.url = payload.url;
|
|
66
|
+
this._solution = { phoneNumber: phoneNumber || this.phoneNumber };
|
|
67
|
+
}
|
|
68
|
+
get _proxy() {
|
|
69
|
+
this._context =
|
|
70
|
+
this._context ||
|
|
71
|
+
new PortingPortabilityContextImpl(this._version, this._solution.phoneNumber);
|
|
72
|
+
return this._context;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Fetch a PortingPortabilityInstance
|
|
76
|
+
*
|
|
77
|
+
* @param callback - Callback to handle processed record
|
|
78
|
+
*
|
|
79
|
+
* @returns Resolves to processed PortingPortabilityInstance
|
|
80
|
+
*/
|
|
81
|
+
fetch(callback) {
|
|
82
|
+
return this._proxy.fetch(callback);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Provide a user-friendly representation
|
|
86
|
+
*
|
|
87
|
+
* @returns Object
|
|
88
|
+
*/
|
|
89
|
+
toJSON() {
|
|
90
|
+
return {
|
|
91
|
+
phoneNumber: this.phoneNumber,
|
|
92
|
+
portable: this.portable,
|
|
93
|
+
pinAndAccountNumberRequired: this.pinAndAccountNumberRequired,
|
|
94
|
+
notPortableReason: this.notPortableReason,
|
|
95
|
+
notPortableReasonCode: this.notPortableReasonCode,
|
|
96
|
+
numberType: this.numberType,
|
|
97
|
+
country: this.country,
|
|
98
|
+
messagingCarrier: this.messagingCarrier,
|
|
99
|
+
voiceCarrier: this.voiceCarrier,
|
|
100
|
+
url: this.url,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
[util_1.inspect.custom](_depth, options) {
|
|
104
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.PortingPortabilityInstance = PortingPortabilityInstance;
|
|
108
|
+
function PortingPortabilityListInstance(version) {
|
|
109
|
+
const instance = ((phoneNumber) => instance.get(phoneNumber));
|
|
110
|
+
instance.get = function get(phoneNumber) {
|
|
111
|
+
return new PortingPortabilityContextImpl(version, phoneNumber);
|
|
112
|
+
};
|
|
113
|
+
instance._version = version;
|
|
114
|
+
instance._solution = {};
|
|
115
|
+
instance._uri = ``;
|
|
116
|
+
instance.toJSON = function toJSON() {
|
|
117
|
+
return instance._solution;
|
|
118
|
+
};
|
|
119
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
120
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
121
|
+
};
|
|
122
|
+
return instance;
|
|
123
|
+
}
|
|
124
|
+
exports.PortingPortabilityListInstance = PortingPortabilityListInstance;
|