twilio 4.7.1 → 4.7.2
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/rest/content/V1.d.ts +5 -0
- package/lib/rest/content/V1.js +7 -0
- package/lib/rest/content/v1/legacyContent.d.ts +202 -0
- package/lib/rest/content/v1/legacyContent.js +138 -0
- package/lib/rest/flexApi/V1.d.ts +15 -0
- package/lib/rest/flexApi/V1.js +22 -0
- package/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts +255 -0
- package/lib/rest/flexApi/v1/insightsAssessmentsComment.js +198 -0
- package/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts +357 -0
- package/lib/rest/flexApi/v1/insightsQuestionnaires.js +280 -0
- package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts +111 -0
- package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js +68 -1
- package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +129 -6
- package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +78 -13
- package/lib/rest/flexApi/v1/insightsSegments.d.ts +224 -0
- package/lib/rest/flexApi/v1/insightsSegments.js +154 -0
- package/lib/rest/flexApi/v1/insightsSession.d.ts +2 -2
- package/lib/rest/flexApi/v1/insightsSession.js +2 -2
- package/lib/rest/flexApi/v1/insightsUserRoles.d.ts +2 -2
- package/lib/rest/flexApi/v1/insightsUserRoles.js +2 -2
- package/lib/rest/lookups/v2/phoneNumber.d.ts +12 -0
- package/lib/rest/lookups/v2/phoneNumber.js +4 -0
- package/lib/rest/microvisor/V1.d.ts +10 -0
- package/lib/rest/microvisor/V1.js +14 -0
- package/lib/rest/microvisor/v1/accountConfig.d.ts +237 -0
- package/lib/rest/microvisor/v1/accountConfig.js +221 -0
- package/lib/rest/microvisor/v1/accountSecret.d.ts +231 -0
- package/lib/rest/microvisor/v1/accountSecret.js +219 -0
- package/lib/rest/microvisor/v1/device/deviceConfig.d.ts +245 -0
- package/lib/rest/microvisor/v1/device/deviceConfig.js +229 -0
- package/lib/rest/microvisor/v1/device/deviceSecret.d.ts +239 -0
- package/lib/rest/microvisor/v1/device/deviceSecret.js +227 -0
- package/lib/rest/microvisor/v1/device.d.ts +16 -0
- package/lib/rest/microvisor/v1/device.js +26 -0
- package/lib/rest/supersim/v1/smsCommand.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
|
4
|
+
import Response from "../../../../http/response";
|
|
5
|
+
import V1 from "../../V1";
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to create a DeviceSecretInstance
|
|
8
|
+
*/
|
|
9
|
+
export interface DeviceSecretListInstanceCreateOptions {
|
|
10
|
+
/** The secret key; up to 100 characters. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** The secret value; up to 4096 characters. */
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options to pass to each
|
|
17
|
+
*/
|
|
18
|
+
export interface DeviceSecretListInstanceEachOptions {
|
|
19
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
22
|
+
callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void;
|
|
23
|
+
/** Function to be called upon completion of streaming */
|
|
24
|
+
done?: Function;
|
|
25
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options to pass to list
|
|
30
|
+
*/
|
|
31
|
+
export interface DeviceSecretListInstanceOptions {
|
|
32
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options to pass to page
|
|
39
|
+
*/
|
|
40
|
+
export interface DeviceSecretListInstancePageOptions {
|
|
41
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
/** Page Number, this value is simply for client state */
|
|
44
|
+
pageNumber?: number;
|
|
45
|
+
/** PageToken provided by the API */
|
|
46
|
+
pageToken?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface DeviceSecretContext {
|
|
49
|
+
/**
|
|
50
|
+
* Remove a DeviceSecretInstance
|
|
51
|
+
*
|
|
52
|
+
* @param callback - Callback to handle processed record
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves to processed boolean
|
|
55
|
+
*/
|
|
56
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Fetch a DeviceSecretInstance
|
|
59
|
+
*
|
|
60
|
+
* @param callback - Callback to handle processed record
|
|
61
|
+
*
|
|
62
|
+
* @returns Resolves to processed DeviceSecretInstance
|
|
63
|
+
*/
|
|
64
|
+
fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise<DeviceSecretInstance>;
|
|
65
|
+
/**
|
|
66
|
+
* Provide a user-friendly representation
|
|
67
|
+
*/
|
|
68
|
+
toJSON(): any;
|
|
69
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
70
|
+
}
|
|
71
|
+
export interface DeviceSecretContextSolution {
|
|
72
|
+
deviceSid: string;
|
|
73
|
+
key: string;
|
|
74
|
+
}
|
|
75
|
+
export declare class DeviceSecretContextImpl implements DeviceSecretContext {
|
|
76
|
+
protected _version: V1;
|
|
77
|
+
protected _solution: DeviceSecretContextSolution;
|
|
78
|
+
protected _uri: string;
|
|
79
|
+
constructor(_version: V1, deviceSid: string, key: string);
|
|
80
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
81
|
+
fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise<DeviceSecretInstance>;
|
|
82
|
+
/**
|
|
83
|
+
* Provide a user-friendly representation
|
|
84
|
+
*
|
|
85
|
+
* @returns Object
|
|
86
|
+
*/
|
|
87
|
+
toJSON(): DeviceSecretContextSolution;
|
|
88
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
89
|
+
}
|
|
90
|
+
interface DeviceSecretPayload extends TwilioResponsePayload {
|
|
91
|
+
secrets: DeviceSecretResource[];
|
|
92
|
+
}
|
|
93
|
+
interface DeviceSecretResource {
|
|
94
|
+
device_sid: string;
|
|
95
|
+
key: string;
|
|
96
|
+
date_rotated: Date;
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
99
|
+
export declare class DeviceSecretInstance {
|
|
100
|
+
protected _version: V1;
|
|
101
|
+
protected _solution: DeviceSecretContextSolution;
|
|
102
|
+
protected _context?: DeviceSecretContext;
|
|
103
|
+
constructor(_version: V1, payload: DeviceSecretResource, deviceSid: string, key?: string);
|
|
104
|
+
/**
|
|
105
|
+
* A 34-character string that uniquely identifies the parent Device.
|
|
106
|
+
*/
|
|
107
|
+
deviceSid: string;
|
|
108
|
+
/**
|
|
109
|
+
* The secret key; up to 100 characters.
|
|
110
|
+
*/
|
|
111
|
+
key: string;
|
|
112
|
+
dateRotated: Date;
|
|
113
|
+
/**
|
|
114
|
+
* The absolute URL of the Secret.
|
|
115
|
+
*/
|
|
116
|
+
url: string;
|
|
117
|
+
private get _proxy();
|
|
118
|
+
/**
|
|
119
|
+
* Remove a DeviceSecretInstance
|
|
120
|
+
*
|
|
121
|
+
* @param callback - Callback to handle processed record
|
|
122
|
+
*
|
|
123
|
+
* @returns Resolves to processed boolean
|
|
124
|
+
*/
|
|
125
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
126
|
+
/**
|
|
127
|
+
* Fetch a DeviceSecretInstance
|
|
128
|
+
*
|
|
129
|
+
* @param callback - Callback to handle processed record
|
|
130
|
+
*
|
|
131
|
+
* @returns Resolves to processed DeviceSecretInstance
|
|
132
|
+
*/
|
|
133
|
+
fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise<DeviceSecretInstance>;
|
|
134
|
+
/**
|
|
135
|
+
* Provide a user-friendly representation
|
|
136
|
+
*
|
|
137
|
+
* @returns Object
|
|
138
|
+
*/
|
|
139
|
+
toJSON(): {
|
|
140
|
+
deviceSid: string;
|
|
141
|
+
key: string;
|
|
142
|
+
dateRotated: Date;
|
|
143
|
+
url: string;
|
|
144
|
+
};
|
|
145
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
146
|
+
}
|
|
147
|
+
export interface DeviceSecretSolution {
|
|
148
|
+
deviceSid: string;
|
|
149
|
+
}
|
|
150
|
+
export interface DeviceSecretListInstance {
|
|
151
|
+
_version: V1;
|
|
152
|
+
_solution: DeviceSecretSolution;
|
|
153
|
+
_uri: string;
|
|
154
|
+
(key: string): DeviceSecretContext;
|
|
155
|
+
get(key: string): DeviceSecretContext;
|
|
156
|
+
/**
|
|
157
|
+
* Create a DeviceSecretInstance
|
|
158
|
+
*
|
|
159
|
+
* @param params - Parameter for request
|
|
160
|
+
* @param callback - Callback to handle processed record
|
|
161
|
+
*
|
|
162
|
+
* @returns Resolves to processed DeviceSecretInstance
|
|
163
|
+
*/
|
|
164
|
+
create(params: DeviceSecretListInstanceCreateOptions, callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise<DeviceSecretInstance>;
|
|
165
|
+
/**
|
|
166
|
+
* Streams DeviceSecretInstance records from the API.
|
|
167
|
+
*
|
|
168
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
169
|
+
* is reached.
|
|
170
|
+
*
|
|
171
|
+
* The results are passed into the callback function, so this operation is memory
|
|
172
|
+
* efficient.
|
|
173
|
+
*
|
|
174
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
175
|
+
* function.
|
|
176
|
+
*
|
|
177
|
+
* @param { DeviceSecretListInstanceEachOptions } [params] - Options for request
|
|
178
|
+
* @param { function } [callback] - Function to process each record
|
|
179
|
+
*/
|
|
180
|
+
each(callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void): void;
|
|
181
|
+
each(params: DeviceSecretListInstanceEachOptions, callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void): void;
|
|
182
|
+
/**
|
|
183
|
+
* Retrieve a single target page of DeviceSecretInstance records from the API.
|
|
184
|
+
*
|
|
185
|
+
* The request is executed immediately.
|
|
186
|
+
*
|
|
187
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
188
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
189
|
+
*/
|
|
190
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise<DeviceSecretPage>;
|
|
191
|
+
/**
|
|
192
|
+
* Lists DeviceSecretInstance records from the API as a list.
|
|
193
|
+
*
|
|
194
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
195
|
+
* function.
|
|
196
|
+
*
|
|
197
|
+
* @param { DeviceSecretListInstanceOptions } [params] - Options for request
|
|
198
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
199
|
+
*/
|
|
200
|
+
list(callback?: (error: Error | null, items: DeviceSecretInstance[]) => any): Promise<DeviceSecretInstance[]>;
|
|
201
|
+
list(params: DeviceSecretListInstanceOptions, callback?: (error: Error | null, items: DeviceSecretInstance[]) => any): Promise<DeviceSecretInstance[]>;
|
|
202
|
+
/**
|
|
203
|
+
* Retrieve a single page of DeviceSecretInstance records from the API.
|
|
204
|
+
*
|
|
205
|
+
* The request is executed immediately.
|
|
206
|
+
*
|
|
207
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
208
|
+
* function.
|
|
209
|
+
*
|
|
210
|
+
* @param { DeviceSecretListInstancePageOptions } [params] - Options for request
|
|
211
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
212
|
+
*/
|
|
213
|
+
page(callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise<DeviceSecretPage>;
|
|
214
|
+
page(params: DeviceSecretListInstancePageOptions, callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise<DeviceSecretPage>;
|
|
215
|
+
/**
|
|
216
|
+
* Provide a user-friendly representation
|
|
217
|
+
*/
|
|
218
|
+
toJSON(): any;
|
|
219
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
220
|
+
}
|
|
221
|
+
export declare function DeviceSecretListInstance(version: V1, deviceSid: string): DeviceSecretListInstance;
|
|
222
|
+
export declare class DeviceSecretPage extends Page<V1, DeviceSecretPayload, DeviceSecretResource, DeviceSecretInstance> {
|
|
223
|
+
/**
|
|
224
|
+
* Initialize the DeviceSecretPage
|
|
225
|
+
*
|
|
226
|
+
* @param version - Version of the resource
|
|
227
|
+
* @param response - Response from the API
|
|
228
|
+
* @param solution - Path solution
|
|
229
|
+
*/
|
|
230
|
+
constructor(version: V1, response: Response<string>, solution: DeviceSecretSolution);
|
|
231
|
+
/**
|
|
232
|
+
* Build an instance of DeviceSecretInstance
|
|
233
|
+
*
|
|
234
|
+
* @param payload - Payload response from the API
|
|
235
|
+
*/
|
|
236
|
+
getInstance(payload: DeviceSecretResource): DeviceSecretInstance;
|
|
237
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
238
|
+
}
|
|
239
|
+
export {};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Microvisor
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.DeviceSecretPage = exports.DeviceSecretListInstance = exports.DeviceSecretInstance = exports.DeviceSecretContextImpl = void 0;
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const Page_1 = __importDefault(require("../../../../base/Page"));
|
|
22
|
+
const deserialize = require("../../../../base/deserialize");
|
|
23
|
+
const serialize = require("../../../../base/serialize");
|
|
24
|
+
const utility_1 = require("../../../../base/utility");
|
|
25
|
+
class DeviceSecretContextImpl {
|
|
26
|
+
constructor(_version, deviceSid, key) {
|
|
27
|
+
this._version = _version;
|
|
28
|
+
if (!(0, utility_1.isValidPathParam)(deviceSid)) {
|
|
29
|
+
throw new Error("Parameter 'deviceSid' is not valid.");
|
|
30
|
+
}
|
|
31
|
+
if (!(0, utility_1.isValidPathParam)(key)) {
|
|
32
|
+
throw new Error("Parameter 'key' is not valid.");
|
|
33
|
+
}
|
|
34
|
+
this._solution = { deviceSid, key };
|
|
35
|
+
this._uri = `/Devices/${deviceSid}/Secrets/${key}`;
|
|
36
|
+
}
|
|
37
|
+
remove(callback) {
|
|
38
|
+
const instance = this;
|
|
39
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
40
|
+
uri: instance._uri,
|
|
41
|
+
method: "delete",
|
|
42
|
+
});
|
|
43
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
44
|
+
return operationPromise;
|
|
45
|
+
}
|
|
46
|
+
fetch(callback) {
|
|
47
|
+
const instance = this;
|
|
48
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
49
|
+
uri: instance._uri,
|
|
50
|
+
method: "get",
|
|
51
|
+
});
|
|
52
|
+
operationPromise = operationPromise.then((payload) => new DeviceSecretInstance(operationVersion, payload, instance._solution.deviceSid, instance._solution.key));
|
|
53
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
54
|
+
return operationPromise;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Provide a user-friendly representation
|
|
58
|
+
*
|
|
59
|
+
* @returns Object
|
|
60
|
+
*/
|
|
61
|
+
toJSON() {
|
|
62
|
+
return this._solution;
|
|
63
|
+
}
|
|
64
|
+
[util_1.inspect.custom](_depth, options) {
|
|
65
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DeviceSecretContextImpl = DeviceSecretContextImpl;
|
|
69
|
+
class DeviceSecretInstance {
|
|
70
|
+
constructor(_version, payload, deviceSid, key) {
|
|
71
|
+
this._version = _version;
|
|
72
|
+
this.deviceSid = payload.device_sid;
|
|
73
|
+
this.key = payload.key;
|
|
74
|
+
this.dateRotated = deserialize.iso8601DateTime(payload.date_rotated);
|
|
75
|
+
this.url = payload.url;
|
|
76
|
+
this._solution = { deviceSid, key: key || this.key };
|
|
77
|
+
}
|
|
78
|
+
get _proxy() {
|
|
79
|
+
this._context =
|
|
80
|
+
this._context ||
|
|
81
|
+
new DeviceSecretContextImpl(this._version, this._solution.deviceSid, this._solution.key);
|
|
82
|
+
return this._context;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Remove a DeviceSecretInstance
|
|
86
|
+
*
|
|
87
|
+
* @param callback - Callback to handle processed record
|
|
88
|
+
*
|
|
89
|
+
* @returns Resolves to processed boolean
|
|
90
|
+
*/
|
|
91
|
+
remove(callback) {
|
|
92
|
+
return this._proxy.remove(callback);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Fetch a DeviceSecretInstance
|
|
96
|
+
*
|
|
97
|
+
* @param callback - Callback to handle processed record
|
|
98
|
+
*
|
|
99
|
+
* @returns Resolves to processed DeviceSecretInstance
|
|
100
|
+
*/
|
|
101
|
+
fetch(callback) {
|
|
102
|
+
return this._proxy.fetch(callback);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Provide a user-friendly representation
|
|
106
|
+
*
|
|
107
|
+
* @returns Object
|
|
108
|
+
*/
|
|
109
|
+
toJSON() {
|
|
110
|
+
return {
|
|
111
|
+
deviceSid: this.deviceSid,
|
|
112
|
+
key: this.key,
|
|
113
|
+
dateRotated: this.dateRotated,
|
|
114
|
+
url: this.url,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
[util_1.inspect.custom](_depth, options) {
|
|
118
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.DeviceSecretInstance = DeviceSecretInstance;
|
|
122
|
+
function DeviceSecretListInstance(version, deviceSid) {
|
|
123
|
+
if (!(0, utility_1.isValidPathParam)(deviceSid)) {
|
|
124
|
+
throw new Error("Parameter 'deviceSid' is not valid.");
|
|
125
|
+
}
|
|
126
|
+
const instance = ((key) => instance.get(key));
|
|
127
|
+
instance.get = function get(key) {
|
|
128
|
+
return new DeviceSecretContextImpl(version, deviceSid, key);
|
|
129
|
+
};
|
|
130
|
+
instance._version = version;
|
|
131
|
+
instance._solution = { deviceSid };
|
|
132
|
+
instance._uri = `/Devices/${deviceSid}/Secrets`;
|
|
133
|
+
instance.create = function create(params, callback) {
|
|
134
|
+
if (params === null || params === undefined) {
|
|
135
|
+
throw new Error('Required parameter "params" missing.');
|
|
136
|
+
}
|
|
137
|
+
if (params["key"] === null || params["key"] === undefined) {
|
|
138
|
+
throw new Error("Required parameter \"params['key']\" missing.");
|
|
139
|
+
}
|
|
140
|
+
if (params["value"] === null || params["value"] === undefined) {
|
|
141
|
+
throw new Error("Required parameter \"params['value']\" missing.");
|
|
142
|
+
}
|
|
143
|
+
let data = {};
|
|
144
|
+
data["Key"] = params["key"];
|
|
145
|
+
data["Value"] = params["value"];
|
|
146
|
+
const headers = {};
|
|
147
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
148
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
149
|
+
uri: instance._uri,
|
|
150
|
+
method: "post",
|
|
151
|
+
data,
|
|
152
|
+
headers,
|
|
153
|
+
});
|
|
154
|
+
operationPromise = operationPromise.then((payload) => new DeviceSecretInstance(operationVersion, payload, instance._solution.deviceSid));
|
|
155
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
156
|
+
return operationPromise;
|
|
157
|
+
};
|
|
158
|
+
instance.page = function page(params, callback) {
|
|
159
|
+
if (params instanceof Function) {
|
|
160
|
+
callback = params;
|
|
161
|
+
params = {};
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
params = params || {};
|
|
165
|
+
}
|
|
166
|
+
let data = {};
|
|
167
|
+
if (params["pageSize"] !== undefined)
|
|
168
|
+
data["PageSize"] = params["pageSize"];
|
|
169
|
+
if (params.pageNumber !== undefined)
|
|
170
|
+
data["Page"] = params.pageNumber;
|
|
171
|
+
if (params.pageToken !== undefined)
|
|
172
|
+
data["PageToken"] = params.pageToken;
|
|
173
|
+
const headers = {};
|
|
174
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
175
|
+
uri: instance._uri,
|
|
176
|
+
method: "get",
|
|
177
|
+
params: data,
|
|
178
|
+
headers,
|
|
179
|
+
});
|
|
180
|
+
operationPromise = operationPromise.then((payload) => new DeviceSecretPage(operationVersion, payload, instance._solution));
|
|
181
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
182
|
+
return operationPromise;
|
|
183
|
+
};
|
|
184
|
+
instance.each = instance._version.each;
|
|
185
|
+
instance.list = instance._version.list;
|
|
186
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
187
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
188
|
+
method: "get",
|
|
189
|
+
uri: targetUrl,
|
|
190
|
+
});
|
|
191
|
+
let pagePromise = operationPromise.then((payload) => new DeviceSecretPage(instance._version, payload, instance._solution));
|
|
192
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
193
|
+
return pagePromise;
|
|
194
|
+
};
|
|
195
|
+
instance.toJSON = function toJSON() {
|
|
196
|
+
return instance._solution;
|
|
197
|
+
};
|
|
198
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
199
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
200
|
+
};
|
|
201
|
+
return instance;
|
|
202
|
+
}
|
|
203
|
+
exports.DeviceSecretListInstance = DeviceSecretListInstance;
|
|
204
|
+
class DeviceSecretPage extends Page_1.default {
|
|
205
|
+
/**
|
|
206
|
+
* Initialize the DeviceSecretPage
|
|
207
|
+
*
|
|
208
|
+
* @param version - Version of the resource
|
|
209
|
+
* @param response - Response from the API
|
|
210
|
+
* @param solution - Path solution
|
|
211
|
+
*/
|
|
212
|
+
constructor(version, response, solution) {
|
|
213
|
+
super(version, response, solution);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Build an instance of DeviceSecretInstance
|
|
217
|
+
*
|
|
218
|
+
* @param payload - Payload response from the API
|
|
219
|
+
*/
|
|
220
|
+
getInstance(payload) {
|
|
221
|
+
return new DeviceSecretInstance(this._version, payload, this._solution.deviceSid);
|
|
222
|
+
}
|
|
223
|
+
[util_1.inspect.custom](depth, options) {
|
|
224
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exports.DeviceSecretPage = DeviceSecretPage;
|
|
@@ -3,6 +3,8 @@ import { inspect, InspectOptions } from "util";
|
|
|
3
3
|
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
4
|
import Response from "../../../http/response";
|
|
5
5
|
import V1 from "../V1";
|
|
6
|
+
import { DeviceConfigListInstance } from "./device/deviceConfig";
|
|
7
|
+
import { DeviceSecretListInstance } from "./device/deviceSecret";
|
|
6
8
|
/**
|
|
7
9
|
* Options to pass to update a DeviceInstance
|
|
8
10
|
*/
|
|
@@ -48,6 +50,8 @@ export interface DeviceListInstancePageOptions {
|
|
|
48
50
|
pageToken?: string;
|
|
49
51
|
}
|
|
50
52
|
export interface DeviceContext {
|
|
53
|
+
deviceConfigs: DeviceConfigListInstance;
|
|
54
|
+
deviceSecrets: DeviceSecretListInstance;
|
|
51
55
|
/**
|
|
52
56
|
* Fetch a DeviceInstance
|
|
53
57
|
*
|
|
@@ -86,7 +90,11 @@ export declare class DeviceContextImpl implements DeviceContext {
|
|
|
86
90
|
protected _version: V1;
|
|
87
91
|
protected _solution: DeviceContextSolution;
|
|
88
92
|
protected _uri: string;
|
|
93
|
+
protected _deviceConfigs?: DeviceConfigListInstance;
|
|
94
|
+
protected _deviceSecrets?: DeviceSecretListInstance;
|
|
89
95
|
constructor(_version: V1, sid: string);
|
|
96
|
+
get deviceConfigs(): DeviceConfigListInstance;
|
|
97
|
+
get deviceSecrets(): DeviceSecretListInstance;
|
|
90
98
|
fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise<DeviceInstance>;
|
|
91
99
|
update(params?: DeviceContextUpdateOptions | ((error: Error | null, item?: DeviceInstance) => any), callback?: (error: Error | null, item?: DeviceInstance) => any): Promise<DeviceInstance>;
|
|
92
100
|
/**
|
|
@@ -178,6 +186,14 @@ export declare class DeviceInstance {
|
|
|
178
186
|
* @returns Resolves to processed DeviceInstance
|
|
179
187
|
*/
|
|
180
188
|
update(params: DeviceContextUpdateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise<DeviceInstance>;
|
|
189
|
+
/**
|
|
190
|
+
* Access the deviceConfigs.
|
|
191
|
+
*/
|
|
192
|
+
deviceConfigs(): DeviceConfigListInstance;
|
|
193
|
+
/**
|
|
194
|
+
* Access the deviceSecrets.
|
|
195
|
+
*/
|
|
196
|
+
deviceSecrets(): DeviceSecretListInstance;
|
|
181
197
|
/**
|
|
182
198
|
* Provide a user-friendly representation
|
|
183
199
|
*
|
|
@@ -22,6 +22,8 @@ const Page_1 = __importDefault(require("../../../base/Page"));
|
|
|
22
22
|
const deserialize = require("../../../base/deserialize");
|
|
23
23
|
const serialize = require("../../../base/serialize");
|
|
24
24
|
const utility_1 = require("../../../base/utility");
|
|
25
|
+
const deviceConfig_1 = require("./device/deviceConfig");
|
|
26
|
+
const deviceSecret_1 = require("./device/deviceSecret");
|
|
25
27
|
class DeviceContextImpl {
|
|
26
28
|
constructor(_version, sid) {
|
|
27
29
|
this._version = _version;
|
|
@@ -31,6 +33,18 @@ class DeviceContextImpl {
|
|
|
31
33
|
this._solution = { sid };
|
|
32
34
|
this._uri = `/Devices/${sid}`;
|
|
33
35
|
}
|
|
36
|
+
get deviceConfigs() {
|
|
37
|
+
this._deviceConfigs =
|
|
38
|
+
this._deviceConfigs ||
|
|
39
|
+
(0, deviceConfig_1.DeviceConfigListInstance)(this._version, this._solution.sid);
|
|
40
|
+
return this._deviceConfigs;
|
|
41
|
+
}
|
|
42
|
+
get deviceSecrets() {
|
|
43
|
+
this._deviceSecrets =
|
|
44
|
+
this._deviceSecrets ||
|
|
45
|
+
(0, deviceSecret_1.DeviceSecretListInstance)(this._version, this._solution.sid);
|
|
46
|
+
return this._deviceSecrets;
|
|
47
|
+
}
|
|
34
48
|
fetch(callback) {
|
|
35
49
|
const instance = this;
|
|
36
50
|
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
@@ -114,6 +128,18 @@ class DeviceInstance {
|
|
|
114
128
|
update(params, callback) {
|
|
115
129
|
return this._proxy.update(params, callback);
|
|
116
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Access the deviceConfigs.
|
|
133
|
+
*/
|
|
134
|
+
deviceConfigs() {
|
|
135
|
+
return this._proxy.deviceConfigs;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Access the deviceSecrets.
|
|
139
|
+
*/
|
|
140
|
+
deviceSecrets() {
|
|
141
|
+
return this._proxy.deviceSecrets;
|
|
142
|
+
}
|
|
117
143
|
/**
|
|
118
144
|
* Provide a user-friendly representation
|
|
119
145
|
*
|
|
@@ -24,7 +24,7 @@ export interface SmsCommandListInstanceCreateOptions {
|
|
|
24
24
|
export interface SmsCommandListInstanceEachOptions {
|
|
25
25
|
/** The SID or unique name of the Sim resource that SMS Command was sent to or from. */
|
|
26
26
|
sim?: string;
|
|
27
|
-
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/
|
|
27
|
+
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */
|
|
28
28
|
status?: SmsCommandStatus;
|
|
29
29
|
/** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */
|
|
30
30
|
direction?: SmsCommandDirection;
|
|
@@ -43,7 +43,7 @@ export interface SmsCommandListInstanceEachOptions {
|
|
|
43
43
|
export interface SmsCommandListInstanceOptions {
|
|
44
44
|
/** The SID or unique name of the Sim resource that SMS Command was sent to or from. */
|
|
45
45
|
sim?: string;
|
|
46
|
-
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/
|
|
46
|
+
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */
|
|
47
47
|
status?: SmsCommandStatus;
|
|
48
48
|
/** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */
|
|
49
49
|
direction?: SmsCommandDirection;
|
|
@@ -58,7 +58,7 @@ export interface SmsCommandListInstanceOptions {
|
|
|
58
58
|
export interface SmsCommandListInstancePageOptions {
|
|
59
59
|
/** The SID or unique name of the Sim resource that SMS Command was sent to or from. */
|
|
60
60
|
sim?: string;
|
|
61
|
-
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/
|
|
61
|
+
/** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */
|
|
62
62
|
status?: SmsCommandStatus;
|
|
63
63
|
/** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */
|
|
64
64
|
direction?: SmsCommandDirection;
|