twilio 5.13.1 → 6.0.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.
Files changed (38) hide show
  1. package/README.md +2 -4
  2. package/lib/rest/MessagingBase.d.ts +3 -0
  3. package/lib/rest/MessagingBase.js +5 -0
  4. package/lib/rest/api/v2010/account/call/transcription.d.ts +2 -0
  5. package/lib/rest/api/v2010/account/call/transcription.js +4 -0
  6. package/lib/rest/api/v2010/account/message.d.ts +2 -0
  7. package/lib/rest/api/v2010/account/message.js +4 -0
  8. package/lib/rest/flexApi/V1.d.ts +0 -5
  9. package/lib/rest/flexApi/V1.js +0 -7
  10. package/lib/rest/iam/V1.d.ts +3 -0
  11. package/lib/rest/iam/V1.js +5 -0
  12. package/lib/rest/iam/v1/rolePermission.d.ts +225 -0
  13. package/lib/rest/iam/v1/rolePermission.js +181 -0
  14. package/lib/rest/insights/v2/inbound.d.ts +8 -8
  15. package/lib/rest/insights/v2/inbound.js +4 -4
  16. package/lib/rest/insights/v2/outbound.d.ts +8 -8
  17. package/lib/rest/insights/v2/outbound.js +4 -4
  18. package/lib/rest/insights/v2/report.d.ts +8 -8
  19. package/lib/rest/insights/v2/report.js +4 -4
  20. package/lib/rest/messaging/V3.d.ts +15 -0
  21. package/lib/rest/messaging/V3.js +37 -0
  22. package/lib/rest/messaging/v2/channelsSender.d.ts +1 -1
  23. package/lib/rest/messaging/v3/typingIndicator.d.ts +90 -0
  24. package/lib/rest/messaging/v3/typingIndicator.js +114 -0
  25. package/lib/rest/numbers/v3/hostedNumberOrder.d.ts +1 -1
  26. package/lib/rest/numbers/v3/hostedNumberOrder.js +2 -1
  27. package/lib/rest/studio/v2/flow/execution.d.ts +12 -0
  28. package/lib/rest/studio/v2/flow/execution.js +6 -0
  29. package/lib/rest/verify/v2/service/approveChallenge.d.ts +6 -6
  30. package/lib/rest/verify/v2/service/approveChallenge.js +2 -2
  31. package/lib/rest/verify/v2/service/newChallenge.d.ts +6 -6
  32. package/lib/rest/verify/v2/service/newChallenge.js +2 -2
  33. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  34. package/lib/rest/video/v1/room.d.ts +4 -1
  35. package/lib/twiml/VoiceResponse.d.ts +10 -0
  36. package/package.json +2 -2
  37. package/lib/rest/flexApi/v1/createFlexInstance.d.ts +0 -165
  38. package/lib/rest/flexApi/v1/createFlexInstance.js +0 -165
package/README.md CHANGED
@@ -19,11 +19,9 @@ The Node library documentation can be found [here][libdocs].
19
19
 
20
20
  This library supports the following Node.js implementations:
21
21
 
22
- - Node.js 14
23
- - Node.js 16
24
- - Node.js 18
25
22
  - Node.js 20
26
- - Node.js lts(22)
23
+ - Node.js 22
24
+ - Node.js 24 (lts)
27
25
 
28
26
  TypeScript is supported for TypeScript version 2.9 and above.
29
27
 
@@ -1,9 +1,11 @@
1
1
  import Domain from "../base/Domain";
2
2
  import V1 from "./messaging/V1";
3
3
  import V2 from "./messaging/V2";
4
+ import V3 from "./messaging/V3";
4
5
  declare class MessagingBase extends Domain {
5
6
  _v1?: V1;
6
7
  _v2?: V2;
8
+ _v3?: V3;
7
9
  /**
8
10
  * Initialize messaging domain
9
11
  *
@@ -12,5 +14,6 @@ declare class MessagingBase extends Domain {
12
14
  constructor(twilio: any);
13
15
  get v1(): V1;
14
16
  get v2(): V2;
17
+ get v3(): V3;
15
18
  }
16
19
  export = MessagingBase;
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  const Domain_1 = __importDefault(require("../base/Domain"));
16
16
  const V1_1 = __importDefault(require("./messaging/V1"));
17
17
  const V2_1 = __importDefault(require("./messaging/V2"));
18
+ const V3_1 = __importDefault(require("./messaging/V3"));
18
19
  class MessagingBase extends Domain_1.default {
19
20
  /**
20
21
  * Initialize messaging domain
@@ -32,5 +33,9 @@ class MessagingBase extends Domain_1.default {
32
33
  this._v2 = this._v2 || new V2_1.default(this);
33
34
  return this._v2;
34
35
  }
36
+ get v3() {
37
+ this._v3 = this._v3 || new V3_1.default(this);
38
+ return this._v3;
39
+ }
35
40
  }
36
41
  module.exports = MessagingBase;
@@ -53,6 +53,8 @@ export interface TranscriptionListInstanceCreateOptions {
53
53
  conversationConfiguration?: string;
54
54
  /** The ID of the Conversation for associating this Transcription with an existing Conversation in Intelligence Service */
55
55
  conversationId?: string;
56
+ /** The ID of the RealTimeTranscription Configuration for configuring all the non-default behaviors in one go. */
57
+ configurationId?: string;
56
58
  /** Whether the callback includes raw provider data. */
57
59
  enableProviderData?: boolean;
58
60
  }
@@ -199,6 +199,8 @@ function TranscriptionListInstance(version, accountSid, callSid) {
199
199
  data["ConversationConfiguration"] = params["conversationConfiguration"];
200
200
  if (params["conversationId"] !== undefined)
201
201
  data["ConversationId"] = params["conversationId"];
202
+ if (params["configurationId"] !== undefined)
203
+ data["ConfigurationId"] = params["configurationId"];
202
204
  if (params["enableProviderData"] !== undefined)
203
205
  data["EnableProviderData"] = serialize.bool(params["enableProviderData"]);
204
206
  const headers = {};
@@ -255,6 +257,8 @@ function TranscriptionListInstance(version, accountSid, callSid) {
255
257
  data["ConversationConfiguration"] = params["conversationConfiguration"];
256
258
  if (params["conversationId"] !== undefined)
257
259
  data["ConversationId"] = params["conversationId"];
260
+ if (params["configurationId"] !== undefined)
261
+ data["ConfigurationId"] = params["configurationId"];
258
262
  if (params["enableProviderData"] !== undefined)
259
263
  data["EnableProviderData"] = serialize.bool(params["enableProviderData"]);
260
264
  const headers = {};
@@ -84,6 +84,8 @@ export interface MessageListInstanceCreateOptions {
84
84
  riskCheck?: MessageRiskCheck;
85
85
  /** The sender\\\'s Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service\\\'s Sender Pool) or you can provide a specific sender from your Sender Pool. */
86
86
  from?: string;
87
+ /** A fallback SMS sender to use when the recipient cannot be reached over RCS. This parameter may only be used when also providing a [Messaging Service](https://twilio.com/docs/messaging/services) containing an RCS sender. The fallback SMS sender must be either a Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), or [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), hosted within Twilio and belong to the Account creating the Message. */
88
+ fallbackFrom?: string;
87
89
  /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service\\\'s Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. */
88
90
  messagingServiceSid?: string;
89
91
  /** The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). */
@@ -360,6 +360,8 @@ function MessageListInstance(version, accountSid) {
360
360
  data["RiskCheck"] = params["riskCheck"];
361
361
  if (params["from"] !== undefined)
362
362
  data["From"] = params["from"];
363
+ if (params["fallbackFrom"] !== undefined)
364
+ data["FallbackFrom"] = params["fallbackFrom"];
363
365
  if (params["messagingServiceSid"] !== undefined)
364
366
  data["MessagingServiceSid"] = params["messagingServiceSid"];
365
367
  if (params["body"] !== undefined)
@@ -428,6 +430,8 @@ function MessageListInstance(version, accountSid) {
428
430
  data["RiskCheck"] = params["riskCheck"];
429
431
  if (params["from"] !== undefined)
430
432
  data["From"] = params["from"];
433
+ if (params["fallbackFrom"] !== undefined)
434
+ data["FallbackFrom"] = params["fallbackFrom"];
431
435
  if (params["messagingServiceSid"] !== undefined)
432
436
  data["MessagingServiceSid"] = params["messagingServiceSid"];
433
437
  if (params["body"] !== undefined)
@@ -3,7 +3,6 @@ import Version from "../../base/Version";
3
3
  import { AssessmentsListInstance } from "./v1/assessments";
4
4
  import { ChannelListInstance } from "./v1/channel";
5
5
  import { ConfigurationListInstance } from "./v1/configuration";
6
- import { CreateFlexInstanceListInstance } from "./v1/createFlexInstance";
7
6
  import { FlexFlowListInstance } from "./v1/flexFlow";
8
7
  import { InsightsAssessmentsCommentListInstance } from "./v1/insightsAssessmentsComment";
9
8
  import { InsightsConversationsListInstance } from "./v1/insightsConversations";
@@ -37,8 +36,6 @@ export default class V1 extends Version {
37
36
  protected _channel?: ChannelListInstance;
38
37
  /** configuration - { Twilio.FlexApi.V1.ConfigurationListInstance } resource */
39
38
  protected _configuration?: ConfigurationListInstance;
40
- /** createFlexInstance - { Twilio.FlexApi.V1.CreateFlexInstanceListInstance } resource */
41
- protected _createFlexInstance?: CreateFlexInstanceListInstance;
42
39
  /** flexFlow - { Twilio.FlexApi.V1.FlexFlowListInstance } resource */
43
40
  protected _flexFlow?: FlexFlowListInstance;
44
41
  /** insightsAssessmentsComment - { Twilio.FlexApi.V1.InsightsAssessmentsCommentListInstance } resource */
@@ -85,8 +82,6 @@ export default class V1 extends Version {
85
82
  get channel(): ChannelListInstance;
86
83
  /** Getter for configuration resource */
87
84
  get configuration(): ConfigurationListInstance;
88
- /** Getter for createFlexInstance resource */
89
- get createFlexInstance(): CreateFlexInstanceListInstance;
90
85
  /** Getter for flexFlow resource */
91
86
  get flexFlow(): FlexFlowListInstance;
92
87
  /** Getter for insightsAssessmentsComment resource */
@@ -20,7 +20,6 @@ const Version_1 = __importDefault(require("../../base/Version"));
20
20
  const assessments_1 = require("./v1/assessments");
21
21
  const channel_1 = require("./v1/channel");
22
22
  const configuration_1 = require("./v1/configuration");
23
- const createFlexInstance_1 = require("./v1/createFlexInstance");
24
23
  const flexFlow_1 = require("./v1/flexFlow");
25
24
  const insightsAssessmentsComment_1 = require("./v1/insightsAssessmentsComment");
26
25
  const insightsConversations_1 = require("./v1/insightsConversations");
@@ -66,12 +65,6 @@ class V1 extends Version_1.default {
66
65
  this._configuration || (0, configuration_1.ConfigurationListInstance)(this);
67
66
  return this._configuration;
68
67
  }
69
- /** Getter for createFlexInstance resource */
70
- get createFlexInstance() {
71
- this._createFlexInstance =
72
- this._createFlexInstance || (0, createFlexInstance_1.CreateFlexInstanceListInstance)(this);
73
- return this._createFlexInstance;
74
- }
75
68
  /** Getter for flexFlow resource */
76
69
  get flexFlow() {
77
70
  this._flexFlow = this._flexFlow || (0, flexFlow_1.FlexFlowListInstance)(this);
@@ -4,6 +4,7 @@ import { ApiKeyListInstance } from "./v1/apiKey";
4
4
  import { GetApiKeysListInstance } from "./v1/getApiKeys";
5
5
  import { NewApiKeyListInstance } from "./v1/newApiKey";
6
6
  import { OAuthAppListInstance } from "./v1/oAuthApp";
7
+ import { RolePermissionListInstance } from "./v1/rolePermission";
7
8
  import { TokenListInstance } from "./v1/token";
8
9
  export default class V1 extends Version {
9
10
  /**
@@ -30,6 +31,8 @@ export default class V1 extends Version {
30
31
  get newApiKey(): NewApiKeyListInstance;
31
32
  /** Getter for oAuthApps resource */
32
33
  get oAuthApps(): OAuthAppListInstance;
34
+ /** Accessor for rolePermission resource */
35
+ rolePermission(RoleSid: string): RolePermissionListInstance;
33
36
  /** Getter for token resource */
34
37
  get token(): TokenListInstance;
35
38
  }
@@ -21,6 +21,7 @@ const apiKey_1 = require("./v1/apiKey");
21
21
  const getApiKeys_1 = require("./v1/getApiKeys");
22
22
  const newApiKey_1 = require("./v1/newApiKey");
23
23
  const oAuthApp_1 = require("./v1/oAuthApp");
24
+ const rolePermission_1 = require("./v1/rolePermission");
24
25
  const token_1 = require("./v1/token");
25
26
  class V1 extends Version_1.default {
26
27
  /**
@@ -51,6 +52,10 @@ class V1 extends Version_1.default {
51
52
  this._oAuthApps = this._oAuthApps || (0, oAuthApp_1.OAuthAppListInstance)(this);
52
53
  return this._oAuthApps;
53
54
  }
55
+ /** Accessor for rolePermission resource */
56
+ rolePermission(RoleSid) {
57
+ return (0, rolePermission_1.RolePermissionListInstance)(this, RoleSid);
58
+ }
54
59
  /** Getter for token resource */
55
60
  get token() {
56
61
  this._token = this._token || (0, token_1.TokenListInstance)(this);
@@ -0,0 +1,225 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
3
+ import Response from "../../../http/response";
4
+ import V1 from "../V1";
5
+ import { ApiResponse } from "../../../base/ApiResponse";
6
+ /**
7
+ * Options to pass to each
8
+ */
9
+ export interface RolePermissionListInstanceEachOptions {
10
+ /** How many resources to return in each list page. The default is 50, and the maximum is 100. */
11
+ pageSize?: number;
12
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
13
+ callback?: (item: RolePermissionInstance, done: (err?: Error) => void) => void;
14
+ /** Function to be called upon completion of streaming */
15
+ done?: Function;
16
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
17
+ limit?: number;
18
+ }
19
+ /**
20
+ * Options to pass to list
21
+ */
22
+ export interface RolePermissionListInstanceOptions {
23
+ /** How many resources to return in each list page. The default is 50, and the maximum is 100. */
24
+ pageSize?: number;
25
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
26
+ limit?: number;
27
+ }
28
+ /**
29
+ * Options to pass to page
30
+ */
31
+ export interface RolePermissionListInstancePageOptions {
32
+ /** How many resources to return in each list page. The default is 50, and the maximum is 100. */
33
+ pageSize?: number;
34
+ /** Page Number, this value is simply for client state */
35
+ pageNumber?: number;
36
+ /** PageToken provided by the API */
37
+ pageToken?: string;
38
+ }
39
+ export interface RolePermissionSolution {
40
+ roleSid: string;
41
+ }
42
+ export interface RolePermissionListInstance {
43
+ _version: V1;
44
+ _solution: RolePermissionSolution;
45
+ _uri: string;
46
+ /**
47
+ * Streams RolePermissionInstance records from the API.
48
+ *
49
+ * This operation lazily loads records as efficiently as possible until the limit
50
+ * is reached.
51
+ *
52
+ * The results are passed into the callback function, so this operation is memory
53
+ * efficient.
54
+ *
55
+ * If a function is passed as the first argument, it will be used as the callback
56
+ * function.
57
+ *
58
+ * @param { RolePermissionListInstanceEachOptions } [params] - Options for request
59
+ * @param { function } [callback] - Function to process each record
60
+ */
61
+ each(callback?: (item: RolePermissionInstance, done: (err?: Error) => void) => void): void;
62
+ each(params: RolePermissionListInstanceEachOptions, callback?: (item: RolePermissionInstance, done: (err?: Error) => void) => void): void;
63
+ /**
64
+ * Streams RolePermissionInstance records from the API with HTTP metadata captured per page.
65
+ *
66
+ * This operation lazily loads records as efficiently as possible until the limit
67
+ * is reached. HTTP metadata (status code, headers) is captured for each page request.
68
+ *
69
+ * The results are passed into the callback function, so this operation is memory
70
+ * efficient.
71
+ *
72
+ * If a function is passed as the first argument, it will be used as the callback
73
+ * function.
74
+ *
75
+ * @param { RolePermissionListInstanceEachOptions } [params] - Options for request
76
+ * @param { function } [callback] - Function to process each record
77
+ */
78
+ eachWithHttpInfo(callback?: (item: RolePermissionInstance, done: (err?: Error) => void) => void): void;
79
+ eachWithHttpInfo(params: RolePermissionListInstanceEachOptions, callback?: (item: RolePermissionInstance, done: (err?: Error) => void) => void): void;
80
+ /**
81
+ * Retrieve a single target page of RolePermissionInstance records from the API.
82
+ *
83
+ * The request is executed immediately.
84
+ *
85
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
86
+ * @param { function } [callback] - Callback to handle list of records
87
+ */
88
+ getPage(targetUrl: string, callback?: (error: Error | null, items: RolePermissionPage) => any): Promise<RolePermissionPage>;
89
+ /**
90
+ * Retrieve a single target page of RolePermissionInstance records from the API with HTTP metadata.
91
+ *
92
+ * The request is executed immediately.
93
+ *
94
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
95
+ * @param { function } [callback] - Callback to handle list of records with metadata
96
+ */
97
+ getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<RolePermissionPage>) => any): Promise<ApiResponse<RolePermissionPage>>;
98
+ /**
99
+ * Lists RolePermissionInstance records from the API as a list.
100
+ *
101
+ * If a function is passed as the first argument, it will be used as the callback
102
+ * function.
103
+ *
104
+ * @param { RolePermissionListInstanceOptions } [params] - Options for request
105
+ * @param { function } [callback] - Callback to handle list of records
106
+ */
107
+ list(callback?: (error: Error | null, items: RolePermissionInstance[]) => any): Promise<RolePermissionInstance[]>;
108
+ list(params: RolePermissionListInstanceOptions, callback?: (error: Error | null, items: RolePermissionInstance[]) => any): Promise<RolePermissionInstance[]>;
109
+ /**
110
+ * Lists RolePermissionInstance records from the API as a list with HTTP metadata.
111
+ *
112
+ * Returns all records along with HTTP metadata from the first page fetched.
113
+ *
114
+ * If a function is passed as the first argument, it will be used as the callback
115
+ * function.
116
+ *
117
+ * @param { RolePermissionListInstanceOptions } [params] - Options for request
118
+ * @param { function } [callback] - Callback to handle list of records with metadata
119
+ */
120
+ listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RolePermissionInstance[]>) => any): Promise<ApiResponse<RolePermissionInstance[]>>;
121
+ listWithHttpInfo(params: RolePermissionListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RolePermissionInstance[]>) => any): Promise<ApiResponse<RolePermissionInstance[]>>;
122
+ /**
123
+ * Retrieve a single page of RolePermissionInstance records from the API.
124
+ *
125
+ * The request is executed immediately.
126
+ *
127
+ * If a function is passed as the first argument, it will be used as the callback
128
+ * function.
129
+ *
130
+ * @param { RolePermissionListInstancePageOptions } [params] - Options for request
131
+ * @param { function } [callback] - Callback to handle list of records
132
+ */
133
+ page(callback?: (error: Error | null, items: RolePermissionPage) => any): Promise<RolePermissionPage>;
134
+ page(params: RolePermissionListInstancePageOptions, callback?: (error: Error | null, items: RolePermissionPage) => any): Promise<RolePermissionPage>;
135
+ /**
136
+ * Retrieve a single page of RolePermissionInstance records from the API with HTTP metadata.
137
+ *
138
+ * The request is executed immediately.
139
+ *
140
+ * If a function is passed as the first argument, it will be used as the callback
141
+ * function.
142
+ *
143
+ * @param { RolePermissionListInstancePageOptions } [params] - Options for request
144
+ * @param { function } [callback] - Callback to handle list of records with metadata
145
+ */
146
+ pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RolePermissionPage>) => any): Promise<ApiResponse<RolePermissionPage>>;
147
+ pageWithHttpInfo(params: RolePermissionListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RolePermissionPage>) => any): Promise<ApiResponse<RolePermissionPage>>;
148
+ /**
149
+ * Provide a user-friendly representation
150
+ */
151
+ toJSON(): any;
152
+ [inspect.custom](_depth: any, options: InspectOptions): any;
153
+ }
154
+ export declare function RolePermissionListInstance(version: V1, roleSid: string): RolePermissionListInstance;
155
+ interface RolePermissionPayload extends TwilioResponsePayload {
156
+ permissions: RolePermissionResource[];
157
+ }
158
+ interface RolePermissionResource {
159
+ sid: string;
160
+ namespace: string;
161
+ product: string;
162
+ resource: string;
163
+ action: string;
164
+ externalDescription: string;
165
+ }
166
+ export declare class RolePermissionInstance {
167
+ protected _version: V1;
168
+ constructor(_version: V1, payload: RolePermissionResource, roleSid?: string);
169
+ /**
170
+ * The unique string that identifies the Permission resource.
171
+ */
172
+ sid: string;
173
+ /**
174
+ * The namespace of the permission (e.g., twilio).
175
+ */
176
+ namespace: string;
177
+ /**
178
+ * The product the permission belongs to (e.g., iam).
179
+ */
180
+ product: string;
181
+ /**
182
+ * The resource the permission applies to (e.g., roles).
183
+ */
184
+ resource: string;
185
+ /**
186
+ * The action granted by the permission (e.g., read).
187
+ */
188
+ action: string;
189
+ /**
190
+ * The external description of the permission.
191
+ */
192
+ externalDescription: string;
193
+ /**
194
+ * Provide a user-friendly representation
195
+ *
196
+ * @returns Object
197
+ */
198
+ toJSON(): {
199
+ sid: string;
200
+ namespace: string;
201
+ product: string;
202
+ resource: string;
203
+ action: string;
204
+ externalDescription: string;
205
+ };
206
+ [inspect.custom](_depth: any, options: InspectOptions): string;
207
+ }
208
+ export declare class RolePermissionPage extends Page<V1, RolePermissionPayload, RolePermissionResource, RolePermissionInstance> {
209
+ /**
210
+ * Initialize the RolePermissionPage
211
+ *
212
+ * @param version - Version of the resource
213
+ * @param response - Response from the API
214
+ * @param solution - Path solution
215
+ */
216
+ constructor(version: V1, response: Response<string>, solution: RolePermissionSolution);
217
+ /**
218
+ * Build an instance of RolePermissionInstance
219
+ *
220
+ * @param payload - Payload response from the API
221
+ */
222
+ getInstance(payload: RolePermissionResource): RolePermissionInstance;
223
+ [inspect.custom](depth: any, options: InspectOptions): string;
224
+ }
225
+ export {};
@@ -0,0 +1,181 @@
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.RolePermissionPage = exports.RolePermissionInstance = void 0;
20
+ exports.RolePermissionListInstance = RolePermissionListInstance;
21
+ const util_1 = require("util");
22
+ const Page_1 = __importDefault(require("../../../base/Page"));
23
+ const deserialize = require("../../../base/deserialize");
24
+ const serialize = require("../../../base/serialize");
25
+ const utility_1 = require("../../../base/utility");
26
+ function RolePermissionListInstance(version, roleSid) {
27
+ if (!(0, utility_1.isValidPathParam)(roleSid)) {
28
+ throw new Error("Parameter 'roleSid' is not valid.");
29
+ }
30
+ const instance = {};
31
+ instance._version = version;
32
+ instance._solution = { roleSid };
33
+ instance._uri = `/Roles/${roleSid}/Permissions`;
34
+ instance.page = function page(params, callback) {
35
+ if (params instanceof Function) {
36
+ callback = params;
37
+ params = {};
38
+ }
39
+ else {
40
+ params = params || {};
41
+ }
42
+ let data = {};
43
+ if (params["pageSize"] !== undefined)
44
+ data["PageSize"] = params["pageSize"];
45
+ if (params.pageNumber !== undefined)
46
+ data["Page"] = params.pageNumber;
47
+ if (params.pageToken !== undefined)
48
+ data["PageToken"] = params.pageToken;
49
+ const headers = {};
50
+ headers["Accept"] = "application/json";
51
+ let operationVersion = version, operationPromise = operationVersion.page({
52
+ uri: instance._uri,
53
+ method: "get",
54
+ params: data,
55
+ headers,
56
+ });
57
+ operationPromise = operationPromise.then((payload) => new RolePermissionPage(operationVersion, payload, instance._solution));
58
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
59
+ return operationPromise;
60
+ };
61
+ instance.each = instance._version.each;
62
+ instance.list = instance._version.list;
63
+ instance.getPage = function getPage(targetUrl, callback) {
64
+ const operationPromise = instance._version._domain.twilio.request({
65
+ method: "get",
66
+ uri: targetUrl,
67
+ });
68
+ let pagePromise = operationPromise.then((payload) => new RolePermissionPage(instance._version, payload, instance._solution));
69
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
70
+ return pagePromise;
71
+ };
72
+ instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
73
+ if (params instanceof Function) {
74
+ callback = params;
75
+ params = {};
76
+ }
77
+ else {
78
+ params = params || {};
79
+ }
80
+ let data = {};
81
+ if (params["pageSize"] !== undefined)
82
+ data["PageSize"] = params["pageSize"];
83
+ if (params.pageNumber !== undefined)
84
+ data["Page"] = params.pageNumber;
85
+ if (params.pageToken !== undefined)
86
+ data["PageToken"] = params.pageToken;
87
+ const headers = {};
88
+ headers["Accept"] = "application/json";
89
+ let operationVersion = version;
90
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
91
+ // IMPORTANT: Pass full response to Page constructor, not response.body
92
+ let operationPromise = operationVersion
93
+ .page({ uri: instance._uri, method: "get", params: data, headers })
94
+ .then((response) => ({
95
+ statusCode: response.statusCode,
96
+ headers: response.headers,
97
+ body: new RolePermissionPage(operationVersion, response, instance._solution),
98
+ }));
99
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
100
+ return operationPromise;
101
+ };
102
+ instance.each = instance._version.each;
103
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
104
+ instance.list = instance._version.list;
105
+ instance.listWithHttpInfo = instance._version.listWithHttpInfo;
106
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
107
+ // Use request() directly as it already returns { statusCode, body, headers }
108
+ const operationPromise = instance._version._domain.twilio.request({
109
+ method: "get",
110
+ uri: targetUrl,
111
+ });
112
+ let pagePromise = operationPromise.then((response) => ({
113
+ statusCode: response.statusCode,
114
+ headers: response.headers,
115
+ body: new RolePermissionPage(instance._version, response, instance._solution),
116
+ }));
117
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
118
+ return pagePromise;
119
+ };
120
+ instance.toJSON = function toJSON() {
121
+ return instance._solution;
122
+ };
123
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
124
+ return (0, util_1.inspect)(instance.toJSON(), options);
125
+ };
126
+ return instance;
127
+ }
128
+ class RolePermissionInstance {
129
+ constructor(_version, payload, roleSid) {
130
+ this._version = _version;
131
+ this.sid = payload.sid;
132
+ this.namespace = payload.namespace;
133
+ this.product = payload.product;
134
+ this.resource = payload.resource;
135
+ this.action = payload.action;
136
+ this.externalDescription = payload.externalDescription;
137
+ }
138
+ /**
139
+ * Provide a user-friendly representation
140
+ *
141
+ * @returns Object
142
+ */
143
+ toJSON() {
144
+ return {
145
+ sid: this.sid,
146
+ namespace: this.namespace,
147
+ product: this.product,
148
+ resource: this.resource,
149
+ action: this.action,
150
+ externalDescription: this.externalDescription,
151
+ };
152
+ }
153
+ [util_1.inspect.custom](_depth, options) {
154
+ return (0, util_1.inspect)(this.toJSON(), options);
155
+ }
156
+ }
157
+ exports.RolePermissionInstance = RolePermissionInstance;
158
+ class RolePermissionPage extends Page_1.default {
159
+ /**
160
+ * Initialize the RolePermissionPage
161
+ *
162
+ * @param version - Version of the resource
163
+ * @param response - Response from the API
164
+ * @param solution - Path solution
165
+ */
166
+ constructor(version, response, solution) {
167
+ super(version, response, solution);
168
+ }
169
+ /**
170
+ * Build an instance of RolePermissionInstance
171
+ *
172
+ * @param payload - Payload response from the API
173
+ */
174
+ getInstance(payload) {
175
+ return new RolePermissionInstance(this._version, payload, this._solution.roleSid);
176
+ }
177
+ [util_1.inspect.custom](depth, options) {
178
+ return (0, util_1.inspect)(this.toJSON(), options);
179
+ }
180
+ }
181
+ exports.RolePermissionPage = RolePermissionPage;
@@ -14,13 +14,13 @@ export declare class InsightsV2CreatePhoneNumbersReportRequest {
14
14
  }
15
15
  export declare class InsightsV2CreatePhoneNumbersReportRequestTimeRange {
16
16
  /**
17
- * Start time of the report
17
+ * Start date time of the report
18
18
  */
19
- "startTime"?: Date;
19
+ "startDatetime"?: Date;
20
20
  /**
21
- * End time of the report
21
+ * End date time of the report
22
22
  */
23
- "endTime"?: Date;
23
+ "endDatetime"?: Date;
24
24
  constructor(payload: any);
25
25
  }
26
26
  /**
@@ -73,13 +73,13 @@ export declare class ReportFilter {
73
73
  }
74
74
  export declare class ReportMetadata {
75
75
  /**
76
- * Start time of the report
76
+ * Start date time of the report
77
77
  */
78
- "startTime"?: Date;
78
+ "startDatetime"?: Date;
79
79
  /**
80
- * End time of the report
80
+ * End date time of the report
81
81
  */
82
- "endTime"?: Date;
82
+ "endDatetime"?: Date;
83
83
  /**
84
84
  * Filter values applied to the report
85
85
  */
@@ -33,8 +33,8 @@ class InsightsV2CreatePhoneNumbersReportRequest {
33
33
  exports.InsightsV2CreatePhoneNumbersReportRequest = InsightsV2CreatePhoneNumbersReportRequest;
34
34
  class InsightsV2CreatePhoneNumbersReportRequestTimeRange {
35
35
  constructor(payload) {
36
- this.startTime = payload["start_time"];
37
- this.endTime = payload["end_time"];
36
+ this.startDatetime = payload["start_datetime"];
37
+ this.endDatetime = payload["end_datetime"];
38
38
  }
39
39
  }
40
40
  exports.InsightsV2CreatePhoneNumbersReportRequestTimeRange = InsightsV2CreatePhoneNumbersReportRequestTimeRange;
@@ -67,8 +67,8 @@ class ReportFilter {
67
67
  exports.ReportFilter = ReportFilter;
68
68
  class ReportMetadata {
69
69
  constructor(payload) {
70
- this.startTime = payload["start_time"];
71
- this.endTime = payload["end_time"];
70
+ this.startDatetime = payload["start_datetime"];
71
+ this.endDatetime = payload["end_datetime"];
72
72
  this.filters = payload["filters"];
73
73
  }
74
74
  }