twilio 3.83.1 → 3.83.3

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.
@@ -0,0 +1,322 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V1 = require('../V1');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ /**
14
+ * Initialize the ContentList
15
+ *
16
+ * PLEASE NOTE that this class contains preview products that are subject to
17
+ * change. Use them with caution. If you currently do not have developer preview
18
+ * access, please contact help@twilio.com.
19
+ *
20
+ * @param version - Version of the resource
21
+ */
22
+ declare function ContentList(version: V1): ContentListInstance;
23
+
24
+ interface ContentListInstance {
25
+ /**
26
+ * @param sid - sid of instance
27
+ */
28
+ (sid: string): ContentContext;
29
+ /**
30
+ * create a ContentInstance
31
+ *
32
+ * @param callback - Callback to handle processed record
33
+ */
34
+ create(callback?: (error: Error | null, item: ContentInstance) => any): Promise<ContentInstance>;
35
+ /**
36
+ * Streams ContentInstance records from the API.
37
+ *
38
+ * This operation lazily loads records as efficiently as possible until the limit
39
+ * is reached.
40
+ *
41
+ * The results are passed into the callback function, so this operation is memory
42
+ * efficient.
43
+ *
44
+ * If a function is passed as the first argument, it will be used as the callback
45
+ * function.
46
+ *
47
+ * @param callback - Function to process each record
48
+ */
49
+ each(callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void;
50
+ /**
51
+ * Streams ContentInstance records from the API.
52
+ *
53
+ * This operation lazily loads records as efficiently as possible until the limit
54
+ * is reached.
55
+ *
56
+ * The results are passed into the callback function, so this operation is memory
57
+ * efficient.
58
+ *
59
+ * If a function is passed as the first argument, it will be used as the callback
60
+ * function.
61
+ *
62
+ * @param opts - Options for request
63
+ * @param callback - Function to process each record
64
+ */
65
+ each(opts?: ContentListInstanceEachOptions, callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void;
66
+ /**
67
+ * Constructs a content
68
+ *
69
+ * @param sid - The unique string that identifies the resource
70
+ */
71
+ get(sid: string): ContentContext;
72
+ /**
73
+ * Retrieve a single target page of ContentInstance records from the API.
74
+ *
75
+ * The request is executed immediately.
76
+ *
77
+ * If a function is passed as the first argument, it will be used as the callback
78
+ * function.
79
+ *
80
+ * @param callback - Callback to handle list of records
81
+ */
82
+ getPage(callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
83
+ /**
84
+ * Retrieve a single target page of ContentInstance records from the API.
85
+ *
86
+ * The request is executed immediately.
87
+ *
88
+ * If a function is passed as the first argument, it will be used as the callback
89
+ * function.
90
+ *
91
+ * @param targetUrl - API-generated URL for the requested results page
92
+ * @param callback - Callback to handle list of records
93
+ */
94
+ getPage(targetUrl?: string, callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
95
+ /**
96
+ * Lists ContentInstance records from the API as a list.
97
+ *
98
+ * If a function is passed as the first argument, it will be used as the callback
99
+ * function.
100
+ *
101
+ * @param callback - Callback to handle list of records
102
+ */
103
+ list(callback?: (error: Error | null, items: ContentInstance[]) => any): Promise<ContentInstance[]>;
104
+ /**
105
+ * Lists ContentInstance records from the API as a list.
106
+ *
107
+ * If a function is passed as the first argument, it will be used as the callback
108
+ * function.
109
+ *
110
+ * @param opts - Options for request
111
+ * @param callback - Callback to handle list of records
112
+ */
113
+ list(opts?: ContentListInstanceOptions, callback?: (error: Error | null, items: ContentInstance[]) => any): Promise<ContentInstance[]>;
114
+ /**
115
+ * Retrieve a single page of ContentInstance records from the API.
116
+ *
117
+ * The request is executed immediately.
118
+ *
119
+ * If a function is passed as the first argument, it will be used as the callback
120
+ * function.
121
+ *
122
+ * @param callback - Callback to handle list of records
123
+ */
124
+ page(callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
125
+ /**
126
+ * Retrieve a single page of ContentInstance records from the API.
127
+ *
128
+ * The request is executed immediately.
129
+ *
130
+ * If a function is passed as the first argument, it will be used as the callback
131
+ * function.
132
+ *
133
+ * @param opts - Options for request
134
+ * @param callback - Callback to handle list of records
135
+ */
136
+ page(opts?: ContentListInstancePageOptions, callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
137
+ /**
138
+ * Provide a user-friendly representation
139
+ */
140
+ toJSON(): any;
141
+ }
142
+
143
+ /**
144
+ * Options to pass to each
145
+ *
146
+ * @property callback -
147
+ * Function to process each record. If this and a positional
148
+ * callback are passed, this one will be used
149
+ * @property done - Function to be called upon completion of streaming
150
+ * @property limit -
151
+ * Upper limit for the number of records to return.
152
+ * each() guarantees never to return more than limit.
153
+ * Default is no limit
154
+ * @property pageSize -
155
+ * Number of records to fetch per request,
156
+ * when not set will use the default value of 50 records.
157
+ * If no pageSize is defined but a limit is defined,
158
+ * each() will attempt to read the limit with the most efficient
159
+ * page size, i.e. min(limit, 1000)
160
+ */
161
+ interface ContentListInstanceEachOptions {
162
+ callback?: (item: ContentInstance, done: (err?: Error) => void) => void;
163
+ done?: Function;
164
+ limit?: number;
165
+ pageSize?: number;
166
+ }
167
+
168
+ /**
169
+ * Options to pass to list
170
+ *
171
+ * @property limit -
172
+ * Upper limit for the number of records to return.
173
+ * list() guarantees never to return more than limit.
174
+ * Default is no limit
175
+ * @property pageSize -
176
+ * Number of records to fetch per request,
177
+ * when not set will use the default value of 50 records.
178
+ * If no page_size is defined but a limit is defined,
179
+ * list() will attempt to read the limit with the most
180
+ * efficient page size, i.e. min(limit, 1000)
181
+ */
182
+ interface ContentListInstanceOptions {
183
+ limit?: number;
184
+ pageSize?: number;
185
+ }
186
+
187
+ /**
188
+ * Options to pass to page
189
+ *
190
+ * @property pageNumber - Page Number, this value is simply for client state
191
+ * @property pageSize - Number of records to return, defaults to 50
192
+ * @property pageToken - PageToken provided by the API
193
+ */
194
+ interface ContentListInstancePageOptions {
195
+ pageNumber?: number;
196
+ pageSize?: number;
197
+ pageToken?: string;
198
+ }
199
+
200
+ interface ContentPayload extends ContentResource, Page.TwilioResponsePayload {
201
+ }
202
+
203
+ interface ContentResource {
204
+ account_sid: string;
205
+ date_created: Date;
206
+ date_updated: Date;
207
+ friendly_name: string;
208
+ language: string;
209
+ links: string;
210
+ sid: string;
211
+ types: object;
212
+ url: string;
213
+ variables: object;
214
+ }
215
+
216
+ interface ContentSolution {
217
+ }
218
+
219
+
220
+ declare class ContentContext {
221
+ /**
222
+ * Initialize the ContentContext
223
+ *
224
+ * PLEASE NOTE that this class contains preview products that are subject to
225
+ * change. Use them with caution. If you currently do not have developer preview
226
+ * access, please contact help@twilio.com.
227
+ *
228
+ * @param version - Version of the resource
229
+ * @param sid - The unique string that identifies the resource
230
+ */
231
+ constructor(version: V1, sid: string);
232
+
233
+ /**
234
+ * fetch a ContentInstance
235
+ *
236
+ * @param callback - Callback to handle processed record
237
+ */
238
+ fetch(callback?: (error: Error | null, items: ContentInstance) => any): Promise<ContentInstance>;
239
+ /**
240
+ * remove a ContentInstance
241
+ *
242
+ * @param callback - Callback to handle processed record
243
+ */
244
+ remove(callback?: (error: Error | null, items: ContentInstance) => any): Promise<boolean>;
245
+ /**
246
+ * Provide a user-friendly representation
247
+ */
248
+ toJSON(): any;
249
+ }
250
+
251
+
252
+ declare class ContentInstance extends SerializableClass {
253
+ /**
254
+ * Initialize the ContentContext
255
+ *
256
+ * PLEASE NOTE that this class contains preview products that are subject to
257
+ * change. Use them with caution. If you currently do not have developer preview
258
+ * access, please contact help@twilio.com.
259
+ *
260
+ * @param version - Version of the resource
261
+ * @param payload - The instance payload
262
+ * @param sid - The unique string that identifies the resource
263
+ */
264
+ constructor(version: V1, payload: ContentPayload, sid: string);
265
+
266
+ private _proxy: ContentContext;
267
+ accountSid: string;
268
+ dateCreated: Date;
269
+ dateUpdated: Date;
270
+ /**
271
+ * fetch a ContentInstance
272
+ *
273
+ * @param callback - Callback to handle processed record
274
+ */
275
+ fetch(callback?: (error: Error | null, items: ContentInstance) => any): Promise<ContentInstance>;
276
+ friendlyName: string;
277
+ language: string;
278
+ links: string;
279
+ /**
280
+ * remove a ContentInstance
281
+ *
282
+ * @param callback - Callback to handle processed record
283
+ */
284
+ remove(callback?: (error: Error | null, items: ContentInstance) => any): Promise<boolean>;
285
+ sid: string;
286
+ /**
287
+ * Provide a user-friendly representation
288
+ */
289
+ toJSON(): any;
290
+ types: any;
291
+ url: string;
292
+ variables: any;
293
+ }
294
+
295
+
296
+ declare class ContentPage extends Page<V1, ContentPayload, ContentResource, ContentInstance> {
297
+ /**
298
+ * Initialize the ContentPage
299
+ *
300
+ * PLEASE NOTE that this class contains preview products that are subject to
301
+ * change. Use them with caution. If you currently do not have developer preview
302
+ * access, please contact help@twilio.com.
303
+ *
304
+ * @param version - Version of the resource
305
+ * @param response - Response from the API
306
+ * @param solution - Path solution
307
+ */
308
+ constructor(version: V1, response: Response<string>, solution: ContentSolution);
309
+
310
+ /**
311
+ * Build an instance of ContentInstance
312
+ *
313
+ * @param payload - Payload response from the API
314
+ */
315
+ getInstance(payload: ContentPayload): ContentInstance;
316
+ /**
317
+ * Provide a user-friendly representation
318
+ */
319
+ toJSON(): any;
320
+ }
321
+
322
+ export { ContentContext, ContentInstance, ContentList, ContentListInstance, ContentListInstanceEachOptions, ContentListInstanceOptions, ContentListInstancePageOptions, ContentPage, ContentPayload, ContentResource, ContentSolution }