twilio-ruby 7.13.0 → 7.13.1

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.
@@ -1,425 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Numbers
8
- # This is the public Twilio REST API.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
-
16
- module Twilio
17
- module REST
18
- class Numbers < NumbersBase
19
- class V3 < Version
20
- class HostedNumberOrderList < ListResource
21
-
22
- ##
23
- # Initialize the HostedNumberOrderList
24
- # @param [Version] version Version that contains the resource
25
- # @return [HostedNumberOrderList] HostedNumberOrderList
26
- def initialize(version)
27
-
28
- apiV1Version = ApiV1Version.new version.domain, version
29
- super(apiV1Version)
30
- # Path Solution
31
- @solution = { }
32
- @uri = "/HostedNumbers/HostedNumberOrders"
33
-
34
- end
35
- ##
36
- # Create the HostedNumberOrderInstance
37
- # @param [String] phone_number The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format
38
- # @param [Boolean] sms_capability Used to specify that the SMS capability will be hosted on Twilio's platform.
39
- # @param [String] account_sid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to.
40
- # @param [String] friendly_name A 64 character string that is a human readable text that describes this resource.
41
- # @param [String] unique_name Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
42
- # @param [Array[String]] cc_emails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to.
43
- # @param [String] sms_url The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource.
44
- # @param [String] sms_method The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource.
45
- # @param [String] sms_fallback_url A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource.
46
- # @param [String] sms_fallback_method The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource.
47
- # @param [String] status_callback_url Optional. The Status Callback URL attached to the IncomingPhoneNumber resource.
48
- # @param [String] status_callback_method Optional. The Status Callback Method attached to the IncomingPhoneNumber resource.
49
- # @param [String] sms_application_sid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application.
50
- # @param [String] address_sid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
51
- # @param [String] email Optional. Email of the owner of this phone number that is being hosted.
52
- # @param [VerificationType] verification_type
53
- # @param [String] verification_document_sid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.
54
- # @return [HostedNumberOrderInstance] Created HostedNumberOrderInstance
55
- def create(
56
- phone_number: nil,
57
- sms_capability: nil,
58
- account_sid: :unset,
59
- friendly_name: :unset,
60
- unique_name: :unset,
61
- cc_emails: :unset,
62
- sms_url: :unset,
63
- sms_method: :unset,
64
- sms_fallback_url: :unset,
65
- sms_fallback_method: :unset,
66
- status_callback_url: :unset,
67
- status_callback_method: :unset,
68
- sms_application_sid: :unset,
69
- address_sid: :unset,
70
- email: :unset,
71
- verification_type: :unset,
72
- verification_document_sid: :unset
73
- )
74
-
75
- data = Twilio::Values.of({
76
- 'phoneNumber' => phone_number,
77
- 'smsCapability' => sms_capability,
78
- 'accountSid' => account_sid,
79
- 'friendlyName' => friendly_name,
80
- 'uniqueName' => unique_name,
81
- 'ccEmails' => Twilio.serialize_list(cc_emails) { |e| e },
82
- 'smsUrl' => sms_url,
83
- 'smsMethod' => sms_method,
84
- 'smsFallbackUrl' => sms_fallback_url,
85
- 'smsFallbackMethod' => sms_fallback_method,
86
- 'statusCallbackUrl' => status_callback_url,
87
- 'statusCallbackMethod' => status_callback_method,
88
- 'smsApplicationSid' => sms_application_sid,
89
- 'addressSid' => address_sid,
90
- 'email' => email,
91
- 'verificationType' => verification_type,
92
- 'verificationDocumentSid' => verification_document_sid,
93
- })
94
-
95
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
96
-
97
-
98
-
99
-
100
-
101
- payload = @version.create('POST', @uri, data: data, headers: headers)
102
- HostedNumberOrderInstance.new(
103
- @version,
104
- payload,
105
- )
106
- end
107
-
108
- ##
109
- # Create the HostedNumberOrderInstanceMetadata
110
- # @param [String] phone_number The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format
111
- # @param [Boolean] sms_capability Used to specify that the SMS capability will be hosted on Twilio's platform.
112
- # @param [String] account_sid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to.
113
- # @param [String] friendly_name A 64 character string that is a human readable text that describes this resource.
114
- # @param [String] unique_name Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
115
- # @param [Array[String]] cc_emails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to.
116
- # @param [String] sms_url The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource.
117
- # @param [String] sms_method The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource.
118
- # @param [String] sms_fallback_url A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource.
119
- # @param [String] sms_fallback_method The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource.
120
- # @param [String] status_callback_url Optional. The Status Callback URL attached to the IncomingPhoneNumber resource.
121
- # @param [String] status_callback_method Optional. The Status Callback Method attached to the IncomingPhoneNumber resource.
122
- # @param [String] sms_application_sid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application.
123
- # @param [String] address_sid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
124
- # @param [String] email Optional. Email of the owner of this phone number that is being hosted.
125
- # @param [VerificationType] verification_type
126
- # @param [String] verification_document_sid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.
127
- # @return [HostedNumberOrderInstance] Created HostedNumberOrderInstance
128
- def create_with_metadata(
129
- phone_number: nil,
130
- sms_capability: nil,
131
- account_sid: :unset,
132
- friendly_name: :unset,
133
- unique_name: :unset,
134
- cc_emails: :unset,
135
- sms_url: :unset,
136
- sms_method: :unset,
137
- sms_fallback_url: :unset,
138
- sms_fallback_method: :unset,
139
- status_callback_url: :unset,
140
- status_callback_method: :unset,
141
- sms_application_sid: :unset,
142
- address_sid: :unset,
143
- email: :unset,
144
- verification_type: :unset,
145
- verification_document_sid: :unset
146
- )
147
-
148
- data = Twilio::Values.of({
149
- 'phoneNumber' => phone_number,
150
- 'smsCapability' => sms_capability,
151
- 'accountSid' => account_sid,
152
- 'friendlyName' => friendly_name,
153
- 'uniqueName' => unique_name,
154
- 'ccEmails' => Twilio.serialize_list(cc_emails) { |e| e },
155
- 'smsUrl' => sms_url,
156
- 'smsMethod' => sms_method,
157
- 'smsFallbackUrl' => sms_fallback_url,
158
- 'smsFallbackMethod' => sms_fallback_method,
159
- 'statusCallbackUrl' => status_callback_url,
160
- 'statusCallbackMethod' => status_callback_method,
161
- 'smsApplicationSid' => sms_application_sid,
162
- 'addressSid' => address_sid,
163
- 'email' => email,
164
- 'verificationType' => verification_type,
165
- 'verificationDocumentSid' => verification_document_sid,
166
- })
167
-
168
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
169
-
170
-
171
-
172
-
173
-
174
- response = @version.create_with_metadata('POST', @uri, data: data, headers: headers)
175
- hosted_number_order_instance = HostedNumberOrderInstance.new(
176
- @version,
177
- response.body,
178
- )
179
- HostedNumberOrderInstanceMetadata.new(
180
- @version,
181
- hosted_number_order_instance,
182
- response.headers,
183
- response.status_code
184
- )
185
- end
186
-
187
-
188
-
189
-
190
- # Provide a user friendly representation
191
- def to_s
192
- '#<Twilio.Numbers.V3.HostedNumberOrderList>'
193
- end
194
- end
195
-
196
- class HostedNumberOrderPage < TokenPage
197
- ##
198
- # Initialize the HostedNumberOrderPage
199
- # @param [Version] version Version that contains the resource
200
- # @param [Response] response Response from the API
201
- # @param [Hash] solution Path solution for the resource
202
- # @return [HostedNumberOrderPage] HostedNumberOrderPage
203
- def initialize(version, response, solution)
204
-
205
- apiV1Version = ApiV1Version.new version.domain, version
206
- super(apiV1Version, response)
207
-
208
- # Path Solution
209
- @solution = solution
210
- end
211
-
212
- ##
213
- # Build an instance of HostedNumberOrderInstance
214
- # @param [Hash] payload Payload response from the API
215
- # @return [HostedNumberOrderInstance] HostedNumberOrderInstance
216
- def get_instance(payload)
217
- HostedNumberOrderInstance.new(@version, payload)
218
- end
219
-
220
- ##
221
- # Provide a user friendly representation
222
- def to_s
223
- '<Twilio.Numbers.V3.HostedNumberOrderPage>'
224
- end
225
- end
226
-
227
- class HostedNumberOrderInstance < InstanceResource
228
- ##
229
- # Initialize the HostedNumberOrderInstance
230
- # @param [Version] version Version that contains the resource
231
- # @param [Hash] payload payload that contains response from Twilio
232
- # @param [String] account_sid The SID of the
233
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this HostedNumberOrder
234
- # resource.
235
- # @param [String] sid The SID of the Call resource to fetch.
236
- # @return [HostedNumberOrderInstance] HostedNumberOrderInstance
237
- def initialize(version, payload )
238
-
239
- apiV1Version = ApiV1Version.new version.domain, version
240
- super(apiV1Version)
241
-
242
- # Marshaled Properties
243
- @properties = {
244
- 'sid' => payload['sid'],
245
- 'account_sid' => payload['account_sid'],
246
- 'incoming_phone_number_sid' => payload['incoming_phone_number_sid'],
247
- 'address_sid' => payload['address_sid'],
248
- 'signing_document_sid' => payload['signing_document_sid'],
249
- 'phone_number' => payload['phone_number'],
250
- 'capabilities' => payload['capabilities'],
251
- 'friendly_name' => payload['friendly_name'],
252
- 'unique_name' => payload['unique_name'],
253
- 'status' => payload['status'],
254
- 'failure_reason' => payload['failure_reason'],
255
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
256
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
257
- 'verification_attempts' => payload['verification_attempts'] == nil ? payload['verification_attempts'] : payload['verification_attempts'].to_i,
258
- 'email' => payload['email'],
259
- 'cc_emails' => payload['cc_emails'],
260
- 'url' => payload['url'],
261
- 'verification_type' => payload['verification_type'],
262
- 'verification_document_sid' => payload['verification_document_sid'],
263
- 'extension' => payload['extension'],
264
- 'call_delay' => payload['call_delay'] == nil ? payload['call_delay'] : payload['call_delay'].to_i,
265
- 'verification_code' => payload['verification_code'],
266
- 'verification_call_sids' => payload['verification_call_sids'],
267
- }
268
- end
269
-
270
-
271
- ##
272
- # @return [String] A 34 character string that uniquely identifies this HostedNumberOrder.
273
- def sid
274
- @properties['sid']
275
- end
276
-
277
- ##
278
- # @return [String] A 34 character string that uniquely identifies the account.
279
- def account_sid
280
- @properties['account_sid']
281
- end
282
-
283
- ##
284
- # @return [String] A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted.
285
- def incoming_phone_number_sid
286
- @properties['incoming_phone_number_sid']
287
- end
288
-
289
- ##
290
- # @return [String] A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
291
- def address_sid
292
- @properties['address_sid']
293
- end
294
-
295
- ##
296
- # @return [String] A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign.
297
- def signing_document_sid
298
- @properties['signing_document_sid']
299
- end
300
-
301
- ##
302
- # @return [String] Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212
303
- def phone_number
304
- @properties['phone_number']
305
- end
306
-
307
- ##
308
- # @return [NumbersV3HostedNumbersHostedNumberOrderCapabilities]
309
- def capabilities
310
- @properties['capabilities']
311
- end
312
-
313
- ##
314
- # @return [String] A 64 character string that is a human-readable text that describes this resource.
315
- def friendly_name
316
- @properties['friendly_name']
317
- end
318
-
319
- ##
320
- # @return [String] Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
321
- def unique_name
322
- @properties['unique_name']
323
- end
324
-
325
- ##
326
- # @return [Status]
327
- def status
328
- @properties['status']
329
- end
330
-
331
- ##
332
- # @return [String] A message that explains why a hosted_number_order went to status \"action-required\"
333
- def failure_reason
334
- @properties['failure_reason']
335
- end
336
-
337
- ##
338
- # @return [Time] The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
339
- def date_created
340
- @properties['date_created']
341
- end
342
-
343
- ##
344
- # @return [Time] The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
345
- def date_updated
346
- @properties['date_updated']
347
- end
348
-
349
- ##
350
- # @return [String] The number of attempts made to verify ownership of the phone number that is being hosted.
351
- def verification_attempts
352
- @properties['verification_attempts']
353
- end
354
-
355
- ##
356
- # @return [String] Email of the owner of this phone number that is being hosted.
357
- def email
358
- @properties['email']
359
- end
360
-
361
- ##
362
- # @return [Array<String>] A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.
363
- def cc_emails
364
- @properties['cc_emails']
365
- end
366
-
367
- ##
368
- # @return [String] The URL of this HostedNumberOrder.
369
- def url
370
- @properties['url']
371
- end
372
-
373
- ##
374
- # @return [VerificationType]
375
- def verification_type
376
- @properties['verification_type']
377
- end
378
-
379
- ##
380
- # @return [String] A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.
381
- def verification_document_sid
382
- @properties['verification_document_sid']
383
- end
384
-
385
- ##
386
- # @return [String] A numerical extension to be used when making the ownership verification call.
387
- def extension
388
- @properties['extension']
389
- end
390
-
391
- ##
392
- # @return [String] A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.
393
- def call_delay
394
- @properties['call_delay']
395
- end
396
-
397
- ##
398
- # @return [String] A verification code provided in the response for a user to enter when they pick up the phone call.
399
- def verification_code
400
- @properties['verification_code']
401
- end
402
-
403
- ##
404
- # @return [Array<String>] A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.
405
- def verification_call_sids
406
- @properties['verification_call_sids']
407
- end
408
-
409
- ##
410
- # Provide a user friendly representation
411
- def to_s
412
- "<Twilio.Numbers.V3.HostedNumberOrderInstance>"
413
- end
414
-
415
- ##
416
- # Provide a detailed, user friendly representation
417
- def inspect
418
- "<Twilio.Numbers.V3.HostedNumberOrderInstance>"
419
- end
420
- end
421
-
422
- end
423
- end
424
- end
425
- end
@@ -1,40 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Numbers
8
- # This is the public Twilio REST API.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
- module Twilio
16
- module REST
17
- class Numbers
18
- class V3 < Version
19
- ##
20
- # Initialize the V3 version of Numbers
21
- def initialize(domain)
22
- super
23
- @version = 'v3'
24
- @hosted_number_orders = nil
25
- end
26
-
27
- ##
28
- # @return [Twilio::REST::Numbers::V3::HostedNumberOrderList]
29
- def hosted_number_orders
30
- @hosted_number_orders ||= HostedNumberOrderList.new self
31
- end
32
- ##
33
- # Provide a user friendly representation
34
- def to_s
35
- '<Twilio::REST::Numbers::V3>';
36
- end
37
- end
38
- end
39
- end
40
- end