twilio 5.2.3 → 5.3.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/rest/Iam.d.ts +4 -0
- package/lib/rest/Iam.js +8 -0
- package/lib/rest/IamBase.d.ts +13 -0
- package/lib/rest/IamBase.js +31 -0
- package/lib/rest/Twilio.d.ts +5 -0
- package/lib/rest/Twilio.js +5 -0
- package/lib/rest/content/v1/content.d.ts +33 -3
- package/lib/rest/content/v1/content.js +16 -1
- package/lib/rest/iam/V1.d.ts +25 -0
- package/lib/rest/iam/V1.js +48 -0
- package/lib/rest/iam/v1/apiKey.d.ts +167 -0
- package/lib/rest/iam/v1/apiKey.js +161 -0
- package/lib/rest/iam/v1/getApiKeys.d.ts +163 -0
- package/lib/rest/iam/v1/getApiKeys.js +124 -0
- package/lib/rest/iam/v1/newApiKey.d.ts +90 -0
- package/lib/rest/iam/v1/newApiKey.js +90 -0
- package/lib/rest/numbers/v1/portingPortIn.js +1 -1
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +6 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts +1 -1
- package/package.json +2 -2
package/lib/rest/Iam.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const IamBase_1 = __importDefault(require("./IamBase"));
|
|
6
|
+
class Iam extends IamBase_1.default {
|
|
7
|
+
}
|
|
8
|
+
module.exports = Iam;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Domain from "../base/Domain";
|
|
2
|
+
import V1 from "./iam/V1";
|
|
3
|
+
declare class IamBase extends Domain {
|
|
4
|
+
_v1?: V1;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize iam domain
|
|
7
|
+
*
|
|
8
|
+
* @param twilio - The twilio client
|
|
9
|
+
*/
|
|
10
|
+
constructor(twilio: any);
|
|
11
|
+
get v1(): V1;
|
|
12
|
+
}
|
|
13
|
+
export = IamBase;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
const Domain_1 = __importDefault(require("../base/Domain"));
|
|
16
|
+
const V1_1 = __importDefault(require("./iam/V1"));
|
|
17
|
+
class IamBase extends Domain_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Initialize iam domain
|
|
20
|
+
*
|
|
21
|
+
* @param twilio - The twilio client
|
|
22
|
+
*/
|
|
23
|
+
constructor(twilio) {
|
|
24
|
+
super(twilio, "https://iam.twilio.com");
|
|
25
|
+
}
|
|
26
|
+
get v1() {
|
|
27
|
+
this._v1 = this._v1 || new V1_1.default(this);
|
|
28
|
+
return this._v1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
module.exports = IamBase;
|
package/lib/rest/Twilio.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import Conversations from "./Conversations";
|
|
|
8
8
|
import Events from "./Events";
|
|
9
9
|
import FlexApi from "./FlexApi";
|
|
10
10
|
import FrontlineApi from "./FrontlineApi";
|
|
11
|
+
import Iam from "./Iam";
|
|
11
12
|
import Insights from "./Insights";
|
|
12
13
|
import Intelligence from "./Intelligence";
|
|
13
14
|
import IpMessaging from "./IpMessaging";
|
|
@@ -80,6 +81,8 @@ declare class Twilio extends Client {
|
|
|
80
81
|
_flexApi?: FlexApi;
|
|
81
82
|
/** (Twilio.FrontlineApi) - frontlineApi domain */
|
|
82
83
|
_frontlineApi?: FrontlineApi;
|
|
84
|
+
/** (Twilio.Iam) - iam domain */
|
|
85
|
+
_iam?: Iam;
|
|
83
86
|
/** (Twilio.Insights) - insights domain */
|
|
84
87
|
_insights?: Insights;
|
|
85
88
|
/** (Twilio.Intelligence) - intelligence domain */
|
|
@@ -162,6 +165,8 @@ declare class Twilio extends Client {
|
|
|
162
165
|
get flexApi(): FlexApi;
|
|
163
166
|
/** Getter for (Twilio.FrontlineApi) domain */
|
|
164
167
|
get frontlineApi(): FrontlineApi;
|
|
168
|
+
/** Getter for (Twilio.Iam) domain */
|
|
169
|
+
get iam(): Iam;
|
|
165
170
|
/** Getter for (Twilio.Insights) domain */
|
|
166
171
|
get insights(): Insights;
|
|
167
172
|
/** Getter for (Twilio.Intelligence) domain */
|
package/lib/rest/Twilio.js
CHANGED
|
@@ -41,6 +41,7 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
41
41
|
this.events;
|
|
42
42
|
this.flexApi;
|
|
43
43
|
this.frontlineApi;
|
|
44
|
+
this.iam;
|
|
44
45
|
this.insights;
|
|
45
46
|
this.intelligence;
|
|
46
47
|
this.ipMessaging;
|
|
@@ -109,6 +110,10 @@ class Twilio extends BaseTwilio_1.Client {
|
|
|
109
110
|
return (this._frontlineApi ??
|
|
110
111
|
(this._frontlineApi = new (require("./FrontlineApi"))(this)));
|
|
111
112
|
}
|
|
113
|
+
/** Getter for (Twilio.Iam) domain */
|
|
114
|
+
get iam() {
|
|
115
|
+
return this._iam ?? (this._iam = new (require("./Iam"))(this));
|
|
116
|
+
}
|
|
112
117
|
/** Getter for (Twilio.Insights) domain */
|
|
113
118
|
get insights() {
|
|
114
119
|
return (this._insights ?? (this._insights = new (require("./Insights"))(this)));
|
|
@@ -15,17 +15,18 @@ export declare class CallToActionAction {
|
|
|
15
15
|
"title": string;
|
|
16
16
|
"url"?: string;
|
|
17
17
|
"phone"?: string;
|
|
18
|
-
"
|
|
18
|
+
"code"?: string;
|
|
19
19
|
}
|
|
20
|
-
export type CallToActionActionType = "URL" | "PHONE_NUMBER";
|
|
20
|
+
export type CallToActionActionType = "URL" | "PHONE_NUMBER" | "COPY_CODE" | "VOICE_CALL";
|
|
21
21
|
export declare class CardAction {
|
|
22
22
|
"type": CardActionType;
|
|
23
23
|
"title": string;
|
|
24
24
|
"url"?: string;
|
|
25
25
|
"phone"?: string;
|
|
26
26
|
"id"?: string;
|
|
27
|
+
"code"?: string;
|
|
27
28
|
}
|
|
28
|
-
export type CardActionType = "URL" | "PHONE_NUMBER" | "QUICK_REPLY";
|
|
29
|
+
export type CardActionType = "URL" | "PHONE_NUMBER" | "QUICK_REPLY" | "COPY_CODE" | "VOICE_CALL";
|
|
29
30
|
export declare class CarouselAction {
|
|
30
31
|
"type": CarouselActionType;
|
|
31
32
|
"title": string;
|
|
@@ -68,6 +69,23 @@ export declare class ContentCreateRequest {
|
|
|
68
69
|
"language": string;
|
|
69
70
|
"types": Types;
|
|
70
71
|
}
|
|
72
|
+
export declare class FlowsPage {
|
|
73
|
+
"id": string;
|
|
74
|
+
"nextPageId"?: string;
|
|
75
|
+
"title"?: string;
|
|
76
|
+
"subtitle"?: string;
|
|
77
|
+
"layout": Array<FlowsPageComponent>;
|
|
78
|
+
}
|
|
79
|
+
export declare class FlowsPageComponent {
|
|
80
|
+
"label": string;
|
|
81
|
+
"type": string;
|
|
82
|
+
"text"?: string;
|
|
83
|
+
"options"?: Array<FlowsPageComponentSelectItem>;
|
|
84
|
+
}
|
|
85
|
+
export declare class FlowsPageComponentSelectItem {
|
|
86
|
+
"id": string;
|
|
87
|
+
"title": string;
|
|
88
|
+
}
|
|
71
89
|
export declare class ListItem {
|
|
72
90
|
"id": string;
|
|
73
91
|
"item": string;
|
|
@@ -113,6 +131,17 @@ export declare class TwilioCatalog {
|
|
|
113
131
|
"items"?: Array<CatalogItem>;
|
|
114
132
|
"dynamicItems"?: string;
|
|
115
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* twilio/flows templates allow you to send multiple messages in a set order with text or select options
|
|
136
|
+
*/
|
|
137
|
+
export declare class TwilioFlows {
|
|
138
|
+
"body": string;
|
|
139
|
+
"buttonText": string;
|
|
140
|
+
"subtitle": string;
|
|
141
|
+
"mediaUrl": string;
|
|
142
|
+
"pages": Array<FlowsPage>;
|
|
143
|
+
"type": string;
|
|
144
|
+
}
|
|
116
145
|
/**
|
|
117
146
|
* twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
|
|
118
147
|
*/
|
|
@@ -162,6 +191,7 @@ export declare class Types {
|
|
|
162
191
|
"twilioCard"?: TwilioCard | null;
|
|
163
192
|
"twilioCatalog"?: TwilioCatalog | null;
|
|
164
193
|
"twilioCarousel"?: TwilioCarousel | null;
|
|
194
|
+
"twilioFlows"?: TwilioFlows | null;
|
|
165
195
|
"whatsappCard"?: WhatsappCard | null;
|
|
166
196
|
"whatsappAuthentication"?: WhatsappAuthentication | null;
|
|
167
197
|
}
|
|
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioCatalog = exports.TwilioCarousel = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.ContentCreateRequest = exports.CatalogItem = exports.CarouselCard = exports.CarouselAction = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
|
|
19
|
+
exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioFlows = exports.TwilioCatalog = exports.TwilioCarousel = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.FlowsPageComponentSelectItem = exports.FlowsPageComponent = exports.FlowsPage = exports.ContentCreateRequest = exports.CatalogItem = exports.CarouselCard = exports.CarouselAction = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
|
|
20
20
|
const util_1 = require("util");
|
|
21
21
|
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
22
|
const deserialize = require("../../../base/deserialize");
|
|
@@ -48,6 +48,15 @@ exports.CatalogItem = CatalogItem;
|
|
|
48
48
|
class ContentCreateRequest {
|
|
49
49
|
}
|
|
50
50
|
exports.ContentCreateRequest = ContentCreateRequest;
|
|
51
|
+
class FlowsPage {
|
|
52
|
+
}
|
|
53
|
+
exports.FlowsPage = FlowsPage;
|
|
54
|
+
class FlowsPageComponent {
|
|
55
|
+
}
|
|
56
|
+
exports.FlowsPageComponent = FlowsPageComponent;
|
|
57
|
+
class FlowsPageComponentSelectItem {
|
|
58
|
+
}
|
|
59
|
+
exports.FlowsPageComponentSelectItem = FlowsPageComponentSelectItem;
|
|
51
60
|
class ListItem {
|
|
52
61
|
}
|
|
53
62
|
exports.ListItem = ListItem;
|
|
@@ -78,6 +87,12 @@ exports.TwilioCarousel = TwilioCarousel;
|
|
|
78
87
|
class TwilioCatalog {
|
|
79
88
|
}
|
|
80
89
|
exports.TwilioCatalog = TwilioCatalog;
|
|
90
|
+
/**
|
|
91
|
+
* twilio/flows templates allow you to send multiple messages in a set order with text or select options
|
|
92
|
+
*/
|
|
93
|
+
class TwilioFlows {
|
|
94
|
+
}
|
|
95
|
+
exports.TwilioFlows = TwilioFlows;
|
|
81
96
|
/**
|
|
82
97
|
* twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
|
|
83
98
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import IamBase from "../IamBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { ApiKeyListInstance } from "./v1/apiKey";
|
|
4
|
+
import { GetApiKeysListInstance } from "./v1/getApiKeys";
|
|
5
|
+
import { NewApiKeyListInstance } from "./v1/newApiKey";
|
|
6
|
+
export default class V1 extends Version {
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the V1 version of Iam
|
|
9
|
+
*
|
|
10
|
+
* @param domain - The Twilio (Twilio.Iam) domain
|
|
11
|
+
*/
|
|
12
|
+
constructor(domain: IamBase);
|
|
13
|
+
/** apiKey - { Twilio.Iam.V1.ApiKeyListInstance } resource */
|
|
14
|
+
protected _apiKey?: ApiKeyListInstance;
|
|
15
|
+
/** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */
|
|
16
|
+
protected _getApiKeys?: GetApiKeysListInstance;
|
|
17
|
+
/** newApiKey - { Twilio.Iam.V1.NewApiKeyListInstance } resource */
|
|
18
|
+
protected _newApiKey?: NewApiKeyListInstance;
|
|
19
|
+
/** Getter for apiKey resource */
|
|
20
|
+
get apiKey(): ApiKeyListInstance;
|
|
21
|
+
/** Getter for getApiKeys resource */
|
|
22
|
+
get getApiKeys(): GetApiKeysListInstance;
|
|
23
|
+
/** Getter for newApiKey resource */
|
|
24
|
+
get newApiKey(): NewApiKeyListInstance;
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Iam
|
|
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
|
+
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const apiKey_1 = require("./v1/apiKey");
|
|
21
|
+
const getApiKeys_1 = require("./v1/getApiKeys");
|
|
22
|
+
const newApiKey_1 = require("./v1/newApiKey");
|
|
23
|
+
class V1 extends Version_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the V1 version of Iam
|
|
26
|
+
*
|
|
27
|
+
* @param domain - The Twilio (Twilio.Iam) domain
|
|
28
|
+
*/
|
|
29
|
+
constructor(domain) {
|
|
30
|
+
super(domain, "v1");
|
|
31
|
+
}
|
|
32
|
+
/** Getter for apiKey resource */
|
|
33
|
+
get apiKey() {
|
|
34
|
+
this._apiKey = this._apiKey || (0, apiKey_1.ApiKeyListInstance)(this);
|
|
35
|
+
return this._apiKey;
|
|
36
|
+
}
|
|
37
|
+
/** Getter for getApiKeys resource */
|
|
38
|
+
get getApiKeys() {
|
|
39
|
+
this._getApiKeys = this._getApiKeys || (0, getApiKeys_1.GetApiKeysListInstance)(this);
|
|
40
|
+
return this._getApiKeys;
|
|
41
|
+
}
|
|
42
|
+
/** Getter for newApiKey resource */
|
|
43
|
+
get newApiKey() {
|
|
44
|
+
this._newApiKey = this._newApiKey || (0, newApiKey_1.NewApiKeyListInstance)(this);
|
|
45
|
+
return this._newApiKey;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = V1;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../V1";
|
|
4
|
+
/**
|
|
5
|
+
* Options to pass to update a ApiKeyInstance
|
|
6
|
+
*/
|
|
7
|
+
export interface ApiKeyContextUpdateOptions {
|
|
8
|
+
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
|
9
|
+
friendlyName?: string;
|
|
10
|
+
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
|
11
|
+
policy?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiKeyContext {
|
|
14
|
+
/**
|
|
15
|
+
* Remove a ApiKeyInstance
|
|
16
|
+
*
|
|
17
|
+
* @param callback - Callback to handle processed record
|
|
18
|
+
*
|
|
19
|
+
* @returns Resolves to processed boolean
|
|
20
|
+
*/
|
|
21
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch a ApiKeyInstance
|
|
24
|
+
*
|
|
25
|
+
* @param callback - Callback to handle processed record
|
|
26
|
+
*
|
|
27
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
28
|
+
*/
|
|
29
|
+
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
30
|
+
/**
|
|
31
|
+
* Update a ApiKeyInstance
|
|
32
|
+
*
|
|
33
|
+
* @param callback - Callback to handle processed record
|
|
34
|
+
*
|
|
35
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
36
|
+
*/
|
|
37
|
+
update(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
38
|
+
/**
|
|
39
|
+
* Update a ApiKeyInstance
|
|
40
|
+
*
|
|
41
|
+
* @param params - Parameter for request
|
|
42
|
+
* @param callback - Callback to handle processed record
|
|
43
|
+
*
|
|
44
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
45
|
+
*/
|
|
46
|
+
update(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
47
|
+
/**
|
|
48
|
+
* Provide a user-friendly representation
|
|
49
|
+
*/
|
|
50
|
+
toJSON(): any;
|
|
51
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
52
|
+
}
|
|
53
|
+
export interface ApiKeyContextSolution {
|
|
54
|
+
sid: string;
|
|
55
|
+
}
|
|
56
|
+
export declare class ApiKeyContextImpl implements ApiKeyContext {
|
|
57
|
+
protected _version: V1;
|
|
58
|
+
protected _solution: ApiKeyContextSolution;
|
|
59
|
+
protected _uri: string;
|
|
60
|
+
constructor(_version: V1, sid: string);
|
|
61
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
62
|
+
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
63
|
+
update(params?: ApiKeyContextUpdateOptions | ((error: Error | null, item?: ApiKeyInstance) => any), callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
64
|
+
/**
|
|
65
|
+
* Provide a user-friendly representation
|
|
66
|
+
*
|
|
67
|
+
* @returns Object
|
|
68
|
+
*/
|
|
69
|
+
toJSON(): ApiKeyContextSolution;
|
|
70
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
71
|
+
}
|
|
72
|
+
interface ApiKeyResource {
|
|
73
|
+
sid: string;
|
|
74
|
+
friendly_name: string;
|
|
75
|
+
date_created: Date;
|
|
76
|
+
date_updated: Date;
|
|
77
|
+
policy: any;
|
|
78
|
+
}
|
|
79
|
+
export declare class ApiKeyInstance {
|
|
80
|
+
protected _version: V1;
|
|
81
|
+
protected _solution: ApiKeyContextSolution;
|
|
82
|
+
protected _context?: ApiKeyContext;
|
|
83
|
+
constructor(_version: V1, payload: ApiKeyResource, sid?: string);
|
|
84
|
+
/**
|
|
85
|
+
* The unique string that we created to identify the Key resource.
|
|
86
|
+
*/
|
|
87
|
+
sid: string;
|
|
88
|
+
/**
|
|
89
|
+
* The string that you assigned to describe the resource.
|
|
90
|
+
*/
|
|
91
|
+
friendlyName: string;
|
|
92
|
+
/**
|
|
93
|
+
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
94
|
+
*/
|
|
95
|
+
dateCreated: Date;
|
|
96
|
+
/**
|
|
97
|
+
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
98
|
+
*/
|
|
99
|
+
dateUpdated: Date;
|
|
100
|
+
/**
|
|
101
|
+
* The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
|
|
102
|
+
*/
|
|
103
|
+
policy: any;
|
|
104
|
+
private get _proxy();
|
|
105
|
+
/**
|
|
106
|
+
* Remove a ApiKeyInstance
|
|
107
|
+
*
|
|
108
|
+
* @param callback - Callback to handle processed record
|
|
109
|
+
*
|
|
110
|
+
* @returns Resolves to processed boolean
|
|
111
|
+
*/
|
|
112
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
113
|
+
/**
|
|
114
|
+
* Fetch a ApiKeyInstance
|
|
115
|
+
*
|
|
116
|
+
* @param callback - Callback to handle processed record
|
|
117
|
+
*
|
|
118
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
119
|
+
*/
|
|
120
|
+
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
121
|
+
/**
|
|
122
|
+
* Update a ApiKeyInstance
|
|
123
|
+
*
|
|
124
|
+
* @param callback - Callback to handle processed record
|
|
125
|
+
*
|
|
126
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
127
|
+
*/
|
|
128
|
+
update(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
129
|
+
/**
|
|
130
|
+
* Update a ApiKeyInstance
|
|
131
|
+
*
|
|
132
|
+
* @param params - Parameter for request
|
|
133
|
+
* @param callback - Callback to handle processed record
|
|
134
|
+
*
|
|
135
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
136
|
+
*/
|
|
137
|
+
update(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
|
138
|
+
/**
|
|
139
|
+
* Provide a user-friendly representation
|
|
140
|
+
*
|
|
141
|
+
* @returns Object
|
|
142
|
+
*/
|
|
143
|
+
toJSON(): {
|
|
144
|
+
sid: string;
|
|
145
|
+
friendlyName: string;
|
|
146
|
+
dateCreated: Date;
|
|
147
|
+
dateUpdated: Date;
|
|
148
|
+
policy: any;
|
|
149
|
+
};
|
|
150
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
151
|
+
}
|
|
152
|
+
export interface ApiKeySolution {
|
|
153
|
+
}
|
|
154
|
+
export interface ApiKeyListInstance {
|
|
155
|
+
_version: V1;
|
|
156
|
+
_solution: ApiKeySolution;
|
|
157
|
+
_uri: string;
|
|
158
|
+
(sid: string): ApiKeyContext;
|
|
159
|
+
get(sid: string): ApiKeyContext;
|
|
160
|
+
/**
|
|
161
|
+
* Provide a user-friendly representation
|
|
162
|
+
*/
|
|
163
|
+
toJSON(): any;
|
|
164
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
165
|
+
}
|
|
166
|
+
export declare function ApiKeyListInstance(version: V1): ApiKeyListInstance;
|
|
167
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Iam
|
|
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.ApiKeyListInstance = exports.ApiKeyInstance = exports.ApiKeyContextImpl = 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 ApiKeyContextImpl {
|
|
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 = `/Keys/${sid}`;
|
|
29
|
+
}
|
|
30
|
+
remove(callback) {
|
|
31
|
+
const instance = this;
|
|
32
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
33
|
+
uri: instance._uri,
|
|
34
|
+
method: "delete",
|
|
35
|
+
});
|
|
36
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
37
|
+
return operationPromise;
|
|
38
|
+
}
|
|
39
|
+
fetch(callback) {
|
|
40
|
+
const instance = this;
|
|
41
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
42
|
+
uri: instance._uri,
|
|
43
|
+
method: "get",
|
|
44
|
+
});
|
|
45
|
+
operationPromise = operationPromise.then((payload) => new ApiKeyInstance(operationVersion, payload, instance._solution.sid));
|
|
46
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
47
|
+
return operationPromise;
|
|
48
|
+
}
|
|
49
|
+
update(params, callback) {
|
|
50
|
+
if (params instanceof Function) {
|
|
51
|
+
callback = params;
|
|
52
|
+
params = {};
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
params = params || {};
|
|
56
|
+
}
|
|
57
|
+
let data = {};
|
|
58
|
+
if (params["friendlyName"] !== undefined)
|
|
59
|
+
data["FriendlyName"] = params["friendlyName"];
|
|
60
|
+
if (params["policy"] !== undefined)
|
|
61
|
+
data["Policy"] = serialize.object(params["policy"]);
|
|
62
|
+
const headers = {};
|
|
63
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
64
|
+
const instance = this;
|
|
65
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
66
|
+
uri: instance._uri,
|
|
67
|
+
method: "post",
|
|
68
|
+
data,
|
|
69
|
+
headers,
|
|
70
|
+
});
|
|
71
|
+
operationPromise = operationPromise.then((payload) => new ApiKeyInstance(operationVersion, payload, instance._solution.sid));
|
|
72
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
73
|
+
return operationPromise;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Provide a user-friendly representation
|
|
77
|
+
*
|
|
78
|
+
* @returns Object
|
|
79
|
+
*/
|
|
80
|
+
toJSON() {
|
|
81
|
+
return this._solution;
|
|
82
|
+
}
|
|
83
|
+
[util_1.inspect.custom](_depth, options) {
|
|
84
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.ApiKeyContextImpl = ApiKeyContextImpl;
|
|
88
|
+
class ApiKeyInstance {
|
|
89
|
+
constructor(_version, payload, sid) {
|
|
90
|
+
this._version = _version;
|
|
91
|
+
this.sid = payload.sid;
|
|
92
|
+
this.friendlyName = payload.friendly_name;
|
|
93
|
+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
|
94
|
+
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
|
95
|
+
this.policy = payload.policy;
|
|
96
|
+
this._solution = { sid: sid || this.sid };
|
|
97
|
+
}
|
|
98
|
+
get _proxy() {
|
|
99
|
+
this._context =
|
|
100
|
+
this._context || new ApiKeyContextImpl(this._version, this._solution.sid);
|
|
101
|
+
return this._context;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Remove a ApiKeyInstance
|
|
105
|
+
*
|
|
106
|
+
* @param callback - Callback to handle processed record
|
|
107
|
+
*
|
|
108
|
+
* @returns Resolves to processed boolean
|
|
109
|
+
*/
|
|
110
|
+
remove(callback) {
|
|
111
|
+
return this._proxy.remove(callback);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Fetch a ApiKeyInstance
|
|
115
|
+
*
|
|
116
|
+
* @param callback - Callback to handle processed record
|
|
117
|
+
*
|
|
118
|
+
* @returns Resolves to processed ApiKeyInstance
|
|
119
|
+
*/
|
|
120
|
+
fetch(callback) {
|
|
121
|
+
return this._proxy.fetch(callback);
|
|
122
|
+
}
|
|
123
|
+
update(params, callback) {
|
|
124
|
+
return this._proxy.update(params, callback);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Provide a user-friendly representation
|
|
128
|
+
*
|
|
129
|
+
* @returns Object
|
|
130
|
+
*/
|
|
131
|
+
toJSON() {
|
|
132
|
+
return {
|
|
133
|
+
sid: this.sid,
|
|
134
|
+
friendlyName: this.friendlyName,
|
|
135
|
+
dateCreated: this.dateCreated,
|
|
136
|
+
dateUpdated: this.dateUpdated,
|
|
137
|
+
policy: this.policy,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
[util_1.inspect.custom](_depth, options) {
|
|
141
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.ApiKeyInstance = ApiKeyInstance;
|
|
145
|
+
function ApiKeyListInstance(version) {
|
|
146
|
+
const instance = ((sid) => instance.get(sid));
|
|
147
|
+
instance.get = function get(sid) {
|
|
148
|
+
return new ApiKeyContextImpl(version, sid);
|
|
149
|
+
};
|
|
150
|
+
instance._version = version;
|
|
151
|
+
instance._solution = {};
|
|
152
|
+
instance._uri = ``;
|
|
153
|
+
instance.toJSON = function toJSON() {
|
|
154
|
+
return instance._solution;
|
|
155
|
+
};
|
|
156
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
157
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
158
|
+
};
|
|
159
|
+
return instance;
|
|
160
|
+
}
|
|
161
|
+
exports.ApiKeyListInstance = ApiKeyListInstance;
|
|
@@ -0,0 +1,163 @@
|
|
|
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 each
|
|
8
|
+
*/
|
|
9
|
+
export interface GetApiKeysListInstanceEachOptions {
|
|
10
|
+
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
11
|
+
accountSid: string;
|
|
12
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
15
|
+
callback?: (item: GetApiKeysInstance, done: (err?: Error) => void) => void;
|
|
16
|
+
/** Function to be called upon completion of streaming */
|
|
17
|
+
done?: Function;
|
|
18
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
19
|
+
limit?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options to pass to list
|
|
23
|
+
*/
|
|
24
|
+
export interface GetApiKeysListInstanceOptions {
|
|
25
|
+
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
26
|
+
accountSid: string;
|
|
27
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
30
|
+
limit?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Options to pass to page
|
|
34
|
+
*/
|
|
35
|
+
export interface GetApiKeysListInstancePageOptions {
|
|
36
|
+
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
37
|
+
accountSid: string;
|
|
38
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
39
|
+
pageSize?: number;
|
|
40
|
+
/** Page Number, this value is simply for client state */
|
|
41
|
+
pageNumber?: number;
|
|
42
|
+
/** PageToken provided by the API */
|
|
43
|
+
pageToken?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface GetApiKeysSolution {
|
|
46
|
+
}
|
|
47
|
+
export interface GetApiKeysListInstance {
|
|
48
|
+
_version: V1;
|
|
49
|
+
_solution: GetApiKeysSolution;
|
|
50
|
+
_uri: string;
|
|
51
|
+
/**
|
|
52
|
+
* Streams GetApiKeysInstance records from the API.
|
|
53
|
+
*
|
|
54
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
55
|
+
* is reached.
|
|
56
|
+
*
|
|
57
|
+
* The results are passed into the callback function, so this operation is memory
|
|
58
|
+
* efficient.
|
|
59
|
+
*
|
|
60
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
61
|
+
* function.
|
|
62
|
+
*
|
|
63
|
+
* @param { GetApiKeysListInstanceEachOptions } [params] - Options for request
|
|
64
|
+
* @param { function } [callback] - Function to process each record
|
|
65
|
+
*/
|
|
66
|
+
each(params: GetApiKeysListInstanceEachOptions, callback?: (item: GetApiKeysInstance, done: (err?: Error) => void) => void): void;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieve a single target page of GetApiKeysInstance records from the API.
|
|
69
|
+
*
|
|
70
|
+
* The request is executed immediately.
|
|
71
|
+
*
|
|
72
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
73
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
74
|
+
*/
|
|
75
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: GetApiKeysPage) => any): Promise<GetApiKeysPage>;
|
|
76
|
+
/**
|
|
77
|
+
* Lists GetApiKeysInstance records from the API as a list.
|
|
78
|
+
*
|
|
79
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
80
|
+
* function.
|
|
81
|
+
*
|
|
82
|
+
* @param { GetApiKeysListInstanceOptions } [params] - Options for request
|
|
83
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
84
|
+
*/
|
|
85
|
+
list(params: GetApiKeysListInstanceOptions, callback?: (error: Error | null, items: GetApiKeysInstance[]) => any): Promise<GetApiKeysInstance[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Retrieve a single page of GetApiKeysInstance records from the API.
|
|
88
|
+
*
|
|
89
|
+
* The request is executed immediately.
|
|
90
|
+
*
|
|
91
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
92
|
+
* function.
|
|
93
|
+
*
|
|
94
|
+
* @param { GetApiKeysListInstancePageOptions } [params] - Options for request
|
|
95
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
96
|
+
*/
|
|
97
|
+
page(params: GetApiKeysListInstancePageOptions, callback?: (error: Error | null, items: GetApiKeysPage) => any): Promise<GetApiKeysPage>;
|
|
98
|
+
/**
|
|
99
|
+
* Provide a user-friendly representation
|
|
100
|
+
*/
|
|
101
|
+
toJSON(): any;
|
|
102
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
103
|
+
}
|
|
104
|
+
export declare function GetApiKeysListInstance(version: V1): GetApiKeysListInstance;
|
|
105
|
+
interface GetApiKeysPayload extends TwilioResponsePayload {
|
|
106
|
+
keys: GetApiKeysResource[];
|
|
107
|
+
}
|
|
108
|
+
interface GetApiKeysResource {
|
|
109
|
+
sid: string;
|
|
110
|
+
friendly_name: string;
|
|
111
|
+
date_created: Date;
|
|
112
|
+
date_updated: Date;
|
|
113
|
+
}
|
|
114
|
+
export declare class GetApiKeysInstance {
|
|
115
|
+
protected _version: V1;
|
|
116
|
+
constructor(_version: V1, payload: GetApiKeysResource);
|
|
117
|
+
/**
|
|
118
|
+
* The unique string that we created to identify the Key resource.
|
|
119
|
+
*/
|
|
120
|
+
sid: string;
|
|
121
|
+
/**
|
|
122
|
+
* The string that you assigned to describe the resource.
|
|
123
|
+
*/
|
|
124
|
+
friendlyName: string;
|
|
125
|
+
/**
|
|
126
|
+
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
127
|
+
*/
|
|
128
|
+
dateCreated: Date;
|
|
129
|
+
/**
|
|
130
|
+
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
131
|
+
*/
|
|
132
|
+
dateUpdated: Date;
|
|
133
|
+
/**
|
|
134
|
+
* Provide a user-friendly representation
|
|
135
|
+
*
|
|
136
|
+
* @returns Object
|
|
137
|
+
*/
|
|
138
|
+
toJSON(): {
|
|
139
|
+
sid: string;
|
|
140
|
+
friendlyName: string;
|
|
141
|
+
dateCreated: Date;
|
|
142
|
+
dateUpdated: Date;
|
|
143
|
+
};
|
|
144
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
145
|
+
}
|
|
146
|
+
export declare class GetApiKeysPage extends Page<V1, GetApiKeysPayload, GetApiKeysResource, GetApiKeysInstance> {
|
|
147
|
+
/**
|
|
148
|
+
* Initialize the GetApiKeysPage
|
|
149
|
+
*
|
|
150
|
+
* @param version - Version of the resource
|
|
151
|
+
* @param response - Response from the API
|
|
152
|
+
* @param solution - Path solution
|
|
153
|
+
*/
|
|
154
|
+
constructor(version: V1, response: Response<string>, solution: GetApiKeysSolution);
|
|
155
|
+
/**
|
|
156
|
+
* Build an instance of GetApiKeysInstance
|
|
157
|
+
*
|
|
158
|
+
* @param payload - Payload response from the API
|
|
159
|
+
*/
|
|
160
|
+
getInstance(payload: GetApiKeysResource): GetApiKeysInstance;
|
|
161
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Iam
|
|
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.GetApiKeysPage = exports.GetApiKeysInstance = exports.GetApiKeysListInstance = 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
|
+
function GetApiKeysListInstance(version) {
|
|
25
|
+
const instance = {};
|
|
26
|
+
instance._version = version;
|
|
27
|
+
instance._solution = {};
|
|
28
|
+
instance._uri = `/Keys`;
|
|
29
|
+
instance.page = function page(params, callback) {
|
|
30
|
+
if (params === null || params === undefined) {
|
|
31
|
+
throw new Error('Required parameter "params" missing.');
|
|
32
|
+
}
|
|
33
|
+
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
|
34
|
+
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
|
35
|
+
}
|
|
36
|
+
let data = {};
|
|
37
|
+
data["AccountSid"] = params["accountSid"];
|
|
38
|
+
if (params["pageSize"] !== undefined)
|
|
39
|
+
data["PageSize"] = params["pageSize"];
|
|
40
|
+
if (params.pageNumber !== undefined)
|
|
41
|
+
data["Page"] = params.pageNumber;
|
|
42
|
+
if (params.pageToken !== undefined)
|
|
43
|
+
data["PageToken"] = params.pageToken;
|
|
44
|
+
const headers = {};
|
|
45
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
46
|
+
uri: instance._uri,
|
|
47
|
+
method: "get",
|
|
48
|
+
params: data,
|
|
49
|
+
headers,
|
|
50
|
+
});
|
|
51
|
+
operationPromise = operationPromise.then((payload) => new GetApiKeysPage(operationVersion, payload, instance._solution));
|
|
52
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
53
|
+
return operationPromise;
|
|
54
|
+
};
|
|
55
|
+
instance.each = instance._version.each;
|
|
56
|
+
instance.list = instance._version.list;
|
|
57
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
58
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
59
|
+
method: "get",
|
|
60
|
+
uri: targetUrl,
|
|
61
|
+
});
|
|
62
|
+
let pagePromise = operationPromise.then((payload) => new GetApiKeysPage(instance._version, payload, instance._solution));
|
|
63
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
64
|
+
return pagePromise;
|
|
65
|
+
};
|
|
66
|
+
instance.toJSON = function toJSON() {
|
|
67
|
+
return instance._solution;
|
|
68
|
+
};
|
|
69
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
70
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
71
|
+
};
|
|
72
|
+
return instance;
|
|
73
|
+
}
|
|
74
|
+
exports.GetApiKeysListInstance = GetApiKeysListInstance;
|
|
75
|
+
class GetApiKeysInstance {
|
|
76
|
+
constructor(_version, payload) {
|
|
77
|
+
this._version = _version;
|
|
78
|
+
this.sid = payload.sid;
|
|
79
|
+
this.friendlyName = payload.friendly_name;
|
|
80
|
+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
|
81
|
+
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Provide a user-friendly representation
|
|
85
|
+
*
|
|
86
|
+
* @returns Object
|
|
87
|
+
*/
|
|
88
|
+
toJSON() {
|
|
89
|
+
return {
|
|
90
|
+
sid: this.sid,
|
|
91
|
+
friendlyName: this.friendlyName,
|
|
92
|
+
dateCreated: this.dateCreated,
|
|
93
|
+
dateUpdated: this.dateUpdated,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
[util_1.inspect.custom](_depth, options) {
|
|
97
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.GetApiKeysInstance = GetApiKeysInstance;
|
|
101
|
+
class GetApiKeysPage extends Page_1.default {
|
|
102
|
+
/**
|
|
103
|
+
* Initialize the GetApiKeysPage
|
|
104
|
+
*
|
|
105
|
+
* @param version - Version of the resource
|
|
106
|
+
* @param response - Response from the API
|
|
107
|
+
* @param solution - Path solution
|
|
108
|
+
*/
|
|
109
|
+
constructor(version, response, solution) {
|
|
110
|
+
super(version, response, solution);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Build an instance of GetApiKeysInstance
|
|
114
|
+
*
|
|
115
|
+
* @param payload - Payload response from the API
|
|
116
|
+
*/
|
|
117
|
+
getInstance(payload) {
|
|
118
|
+
return new GetApiKeysInstance(this._version, payload);
|
|
119
|
+
}
|
|
120
|
+
[util_1.inspect.custom](depth, options) {
|
|
121
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.GetApiKeysPage = GetApiKeysPage;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../V1";
|
|
4
|
+
export type NewApiKeyKeytype = "restricted";
|
|
5
|
+
/**
|
|
6
|
+
* Options to pass to create a NewApiKeyInstance
|
|
7
|
+
*/
|
|
8
|
+
export interface NewApiKeyListInstanceCreateOptions {
|
|
9
|
+
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
10
|
+
accountSid: string;
|
|
11
|
+
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
|
12
|
+
friendlyName?: string;
|
|
13
|
+
/** */
|
|
14
|
+
keyType?: NewApiKeyKeytype;
|
|
15
|
+
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
|
16
|
+
policy?: any;
|
|
17
|
+
}
|
|
18
|
+
export interface NewApiKeySolution {
|
|
19
|
+
}
|
|
20
|
+
export interface NewApiKeyListInstance {
|
|
21
|
+
_version: V1;
|
|
22
|
+
_solution: NewApiKeySolution;
|
|
23
|
+
_uri: string;
|
|
24
|
+
/**
|
|
25
|
+
* Create a NewApiKeyInstance
|
|
26
|
+
*
|
|
27
|
+
* @param params - Parameter for request
|
|
28
|
+
* @param callback - Callback to handle processed record
|
|
29
|
+
*
|
|
30
|
+
* @returns Resolves to processed NewApiKeyInstance
|
|
31
|
+
*/
|
|
32
|
+
create(params: NewApiKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: NewApiKeyInstance) => any): Promise<NewApiKeyInstance>;
|
|
33
|
+
/**
|
|
34
|
+
* Provide a user-friendly representation
|
|
35
|
+
*/
|
|
36
|
+
toJSON(): any;
|
|
37
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
38
|
+
}
|
|
39
|
+
export declare function NewApiKeyListInstance(version: V1): NewApiKeyListInstance;
|
|
40
|
+
interface NewApiKeyResource {
|
|
41
|
+
sid: string;
|
|
42
|
+
friendly_name: string;
|
|
43
|
+
date_created: Date;
|
|
44
|
+
date_updated: Date;
|
|
45
|
+
secret: string;
|
|
46
|
+
policy: any;
|
|
47
|
+
}
|
|
48
|
+
export declare class NewApiKeyInstance {
|
|
49
|
+
protected _version: V1;
|
|
50
|
+
constructor(_version: V1, payload: NewApiKeyResource);
|
|
51
|
+
/**
|
|
52
|
+
* The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
|
|
53
|
+
*/
|
|
54
|
+
sid: string;
|
|
55
|
+
/**
|
|
56
|
+
* The string that you assigned to describe the resource.
|
|
57
|
+
*/
|
|
58
|
+
friendlyName: string;
|
|
59
|
+
/**
|
|
60
|
+
* The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
61
|
+
*/
|
|
62
|
+
dateCreated: Date;
|
|
63
|
+
/**
|
|
64
|
+
* The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
|
65
|
+
*/
|
|
66
|
+
dateUpdated: Date;
|
|
67
|
+
/**
|
|
68
|
+
* The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.**
|
|
69
|
+
*/
|
|
70
|
+
secret: string;
|
|
71
|
+
/**
|
|
72
|
+
* Collection of allow assertions.
|
|
73
|
+
*/
|
|
74
|
+
policy: any;
|
|
75
|
+
/**
|
|
76
|
+
* Provide a user-friendly representation
|
|
77
|
+
*
|
|
78
|
+
* @returns Object
|
|
79
|
+
*/
|
|
80
|
+
toJSON(): {
|
|
81
|
+
sid: string;
|
|
82
|
+
friendlyName: string;
|
|
83
|
+
dateCreated: Date;
|
|
84
|
+
dateUpdated: Date;
|
|
85
|
+
secret: string;
|
|
86
|
+
policy: any;
|
|
87
|
+
};
|
|
88
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Iam
|
|
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.NewApiKeyInstance = exports.NewApiKeyListInstance = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../base/serialize");
|
|
20
|
+
function NewApiKeyListInstance(version) {
|
|
21
|
+
const instance = {};
|
|
22
|
+
instance._version = version;
|
|
23
|
+
instance._solution = {};
|
|
24
|
+
instance._uri = `/Keys`;
|
|
25
|
+
instance.create = function create(params, callback) {
|
|
26
|
+
if (params === null || params === undefined) {
|
|
27
|
+
throw new Error('Required parameter "params" missing.');
|
|
28
|
+
}
|
|
29
|
+
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
|
30
|
+
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
|
31
|
+
}
|
|
32
|
+
let data = {};
|
|
33
|
+
data["AccountSid"] = params["accountSid"];
|
|
34
|
+
if (params["friendlyName"] !== undefined)
|
|
35
|
+
data["FriendlyName"] = params["friendlyName"];
|
|
36
|
+
if (params["keyType"] !== undefined)
|
|
37
|
+
data["KeyType"] = params["keyType"];
|
|
38
|
+
if (params["policy"] !== undefined)
|
|
39
|
+
data["Policy"] = serialize.object(params["policy"]);
|
|
40
|
+
const headers = {};
|
|
41
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
42
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
43
|
+
uri: instance._uri,
|
|
44
|
+
method: "post",
|
|
45
|
+
data,
|
|
46
|
+
headers,
|
|
47
|
+
});
|
|
48
|
+
operationPromise = operationPromise.then((payload) => new NewApiKeyInstance(operationVersion, payload));
|
|
49
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
50
|
+
return operationPromise;
|
|
51
|
+
};
|
|
52
|
+
instance.toJSON = function toJSON() {
|
|
53
|
+
return instance._solution;
|
|
54
|
+
};
|
|
55
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
56
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
57
|
+
};
|
|
58
|
+
return instance;
|
|
59
|
+
}
|
|
60
|
+
exports.NewApiKeyListInstance = NewApiKeyListInstance;
|
|
61
|
+
class NewApiKeyInstance {
|
|
62
|
+
constructor(_version, payload) {
|
|
63
|
+
this._version = _version;
|
|
64
|
+
this.sid = payload.sid;
|
|
65
|
+
this.friendlyName = payload.friendly_name;
|
|
66
|
+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
|
67
|
+
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
|
68
|
+
this.secret = payload.secret;
|
|
69
|
+
this.policy = payload.policy;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Provide a user-friendly representation
|
|
73
|
+
*
|
|
74
|
+
* @returns Object
|
|
75
|
+
*/
|
|
76
|
+
toJSON() {
|
|
77
|
+
return {
|
|
78
|
+
sid: this.sid,
|
|
79
|
+
friendlyName: this.friendlyName,
|
|
80
|
+
dateCreated: this.dateCreated,
|
|
81
|
+
dateUpdated: this.dateUpdated,
|
|
82
|
+
secret: this.secret,
|
|
83
|
+
policy: this.policy,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
[util_1.inspect.custom](_depth, options) {
|
|
87
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.NewApiKeyInstance = NewApiKeyInstance;
|
|
@@ -73,7 +73,7 @@ class PortingPortInInstance {
|
|
|
73
73
|
this.losingCarrierInformation = payload.losing_carrier_information;
|
|
74
74
|
this.phoneNumbers = payload.phone_numbers;
|
|
75
75
|
this.documents = payload.documents;
|
|
76
|
-
this.dateCreated = deserialize.
|
|
76
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
77
77
|
this._solution = {
|
|
78
78
|
portInRequestSid: portInRequestSid || this.portInRequestSid,
|
|
79
79
|
};
|
|
@@ -126,6 +126,7 @@ interface SupportingDocumentResource {
|
|
|
126
126
|
mime_type: string;
|
|
127
127
|
status: SupportingDocumentStatus;
|
|
128
128
|
failure_reason: string;
|
|
129
|
+
errors: Array<any>;
|
|
129
130
|
type: string;
|
|
130
131
|
attributes: any;
|
|
131
132
|
date_created: Date;
|
|
@@ -158,6 +159,10 @@ export declare class SupportingDocumentInstance {
|
|
|
158
159
|
* The failure reason of the Supporting Document Resource.
|
|
159
160
|
*/
|
|
160
161
|
failureReason: string;
|
|
162
|
+
/**
|
|
163
|
+
* A list of errors that occurred during the registering RC Bundle
|
|
164
|
+
*/
|
|
165
|
+
errors: Array<any>;
|
|
161
166
|
/**
|
|
162
167
|
* The type of the Supporting Document.
|
|
163
168
|
*/
|
|
@@ -224,6 +229,7 @@ export declare class SupportingDocumentInstance {
|
|
|
224
229
|
mimeType: string;
|
|
225
230
|
status: SupportingDocumentStatus;
|
|
226
231
|
failureReason: string;
|
|
232
|
+
errors: any[];
|
|
227
233
|
type: string;
|
|
228
234
|
attributes: any;
|
|
229
235
|
dateCreated: Date;
|
|
@@ -98,6 +98,7 @@ class SupportingDocumentInstance {
|
|
|
98
98
|
this.mimeType = payload.mime_type;
|
|
99
99
|
this.status = payload.status;
|
|
100
100
|
this.failureReason = payload.failure_reason;
|
|
101
|
+
this.errors = payload.errors;
|
|
101
102
|
this.type = payload.type;
|
|
102
103
|
this.attributes = payload.attributes;
|
|
103
104
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
@@ -147,6 +148,7 @@ class SupportingDocumentInstance {
|
|
|
147
148
|
mimeType: this.mimeType,
|
|
148
149
|
status: this.status,
|
|
149
150
|
failureReason: this.failureReason,
|
|
151
|
+
errors: this.errors,
|
|
150
152
|
type: this.type,
|
|
151
153
|
attributes: this.attributes,
|
|
152
154
|
dateCreated: this.dateCreated,
|
|
@@ -108,7 +108,7 @@ export declare class TaskQueueRealTimeStatisticsInstance {
|
|
|
108
108
|
*/
|
|
109
109
|
tasksByStatus: any;
|
|
110
110
|
/**
|
|
111
|
-
* The total number of Workers available
|
|
111
|
+
* The total number of Workers in the TaskQueue with an `available` status. Workers with an `available` status may already have active interactions or may have none.
|
|
112
112
|
*/
|
|
113
113
|
totalAvailableWorkers: number;
|
|
114
114
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twilio",
|
|
3
3
|
"description": "A Twilio helper library",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.3.0",
|
|
5
5
|
"author": "API Team <api@twilio.com>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
{
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "https://github.com/twilio/twilio-node.git"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"axios": "^1.
|
|
23
|
+
"axios": "^1.7.4",
|
|
24
24
|
"dayjs": "^1.11.9",
|
|
25
25
|
"https-proxy-agent": "^5.0.0",
|
|
26
26
|
"jsonwebtoken": "^9.0.2",
|