twilio-ruby 7.0.1 → 7.1.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +55 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +6 -6
  6. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
  7. data/lib/twilio-ruby/rest/client.rb +0 -5
  8. data/lib/twilio-ruby/rest/content/v2/content.rb +259 -0
  9. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +252 -0
  10. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  11. data/lib/twilio-ruby/rest/content_base.rb +6 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
  13. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
  14. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +289 -0
  15. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +5 -2
  16. data/lib/twilio-ruby/rest/flex_api/v2.rb +37 -0
  17. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
  18. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
  19. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
  20. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
  21. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
  22. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
  23. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
  24. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
  25. data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
  26. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
  27. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +154 -4
  28. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +292 -0
  29. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  30. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  31. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  32. data/lib/twilio-ruby/rest/numbers/v1.rb +63 -20
  33. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  34. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  35. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  36. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  37. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  38. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  39. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  40. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  41. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  42. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  43. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  44. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  45. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  46. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  47. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  49. data/lib/twilio-ruby/version.rb +1 -1
  50. metadata +16 -9
  51. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  52. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  53. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  54. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  55. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  56. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
  57. data/lib/twilio-ruby/rest/preview_messaging_base.rb +0 -38
@@ -54,6 +54,61 @@ module Twilio
54
54
  end
55
55
  end
56
56
 
57
+
58
+ class PortingPortInContext < InstanceContext
59
+ ##
60
+ # Initialize the PortingPortInContext
61
+ # @param [Version] version Version that contains the resource
62
+ # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request.
63
+ # @return [PortingPortInContext] PortingPortInContext
64
+ def initialize(version, port_in_request_sid)
65
+ super(version)
66
+
67
+ # Path Solution
68
+ @solution = { port_in_request_sid: port_in_request_sid, }
69
+ @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}"
70
+
71
+
72
+ end
73
+ ##
74
+ # Delete the PortingPortInInstance
75
+ # @return [Boolean] True if delete succeeds, false otherwise
76
+ def delete
77
+
78
+
79
+ @version.delete('DELETE', @uri)
80
+ end
81
+
82
+ ##
83
+ # Fetch the PortingPortInInstance
84
+ # @return [PortingPortInInstance] Fetched PortingPortInInstance
85
+ def fetch
86
+
87
+
88
+ payload = @version.fetch('GET', @uri)
89
+ PortingPortInInstance.new(
90
+ @version,
91
+ payload,
92
+ port_in_request_sid: @solution[:port_in_request_sid],
93
+ )
94
+ end
95
+
96
+
97
+ ##
98
+ # Provide a user friendly representation
99
+ def to_s
100
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
101
+ "#<Twilio.Numbers.V1.PortingPortInContext #{context}>"
102
+ end
103
+
104
+ ##
105
+ # Provide a detailed, user friendly representation
106
+ def inspect
107
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Numbers.V1.PortingPortInContext #{context}>"
109
+ end
110
+ end
111
+
57
112
  class PortingPortInPage < Page
58
113
  ##
59
114
  # Initialize the PortingPortInPage
@@ -92,16 +147,39 @@ module Twilio
92
147
  # resource.
93
148
  # @param [String] sid The SID of the Call resource to fetch.
94
149
  # @return [PortingPortInInstance] PortingPortInInstance
95
- def initialize(version, payload )
150
+ def initialize(version, payload , port_in_request_sid: nil)
96
151
  super(version)
97
152
 
98
153
  # Marshaled Properties
99
154
  @properties = {
100
155
  'port_in_request_sid' => payload['port_in_request_sid'],
101
156
  'url' => payload['url'],
157
+ 'account_sid' => payload['account_sid'],
158
+ 'notification_emails' => payload['notification_emails'],
159
+ 'target_port_in_date' => Twilio.deserialize_iso8601_date(payload['target_port_in_date']),
160
+ 'target_port_in_time_range_start' => payload['target_port_in_time_range_start'],
161
+ 'target_port_in_time_range_end' => payload['target_port_in_time_range_end'],
162
+ 'port_in_request_status' => payload['port_in_request_status'],
163
+ 'losing_carrier_information' => payload['losing_carrier_information'],
164
+ 'phone_numbers' => payload['phone_numbers'],
165
+ 'documents' => payload['documents'],
102
166
  }
167
+
168
+ # Context
169
+ @instance_context = nil
170
+ @params = { 'port_in_request_sid' => port_in_request_sid || @properties['port_in_request_sid'] , }
103
171
  end
104
172
 
173
+ ##
174
+ # Generate an instance context for the instance, the context is capable of
175
+ # performing various actions. All instance actions are proxied to the context
176
+ # @return [PortingPortInContext] CallContext for this CallInstance
177
+ def context
178
+ unless @instance_context
179
+ @instance_context = PortingPortInContext.new(@version , @params['port_in_request_sid'])
180
+ end
181
+ @instance_context
182
+ end
105
183
 
106
184
  ##
107
185
  # @return [String] The SID of the Port In request. This is a unique identifier of the port in request.
@@ -110,21 +188,93 @@ module Twilio
110
188
  end
111
189
 
112
190
  ##
113
- # @return [String]
191
+ # @return [String] The URL of this Port In request
114
192
  def url
115
193
  @properties['url']
116
194
  end
117
195
 
196
+ ##
197
+ # @return [String] The Account SID that the numbers will be added to after they are ported into Twilio.
198
+ def account_sid
199
+ @properties['account_sid']
200
+ end
201
+
202
+ ##
203
+ # @return [Array<String>] List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails.
204
+ def notification_emails
205
+ @properties['notification_emails']
206
+ end
207
+
208
+ ##
209
+ # @return [Date] Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation.
210
+ def target_port_in_date
211
+ @properties['target_port_in_date']
212
+ end
213
+
214
+ ##
215
+ # @return [String] Minimum hour in the future needs to be established with the Ops team for validation.
216
+ def target_port_in_time_range_start
217
+ @properties['target_port_in_time_range_start']
218
+ end
219
+
220
+ ##
221
+ # @return [String] Maximum hour in the future needs to be established with the Ops team for validation.
222
+ def target_port_in_time_range_end
223
+ @properties['target_port_in_time_range_end']
224
+ end
225
+
226
+ ##
227
+ # @return [String] The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
228
+ def port_in_request_status
229
+ @properties['port_in_request_status']
230
+ end
231
+
232
+ ##
233
+ # @return [Hash] The information for the losing carrier.
234
+ def losing_carrier_information
235
+ @properties['losing_carrier_information']
236
+ end
237
+
238
+ ##
239
+ # @return [Array<Hash>] The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212).
240
+ def phone_numbers
241
+ @properties['phone_numbers']
242
+ end
243
+
244
+ ##
245
+ # @return [Array<String>] The list of documents SID referencing a utility bills
246
+ def documents
247
+ @properties['documents']
248
+ end
249
+
250
+ ##
251
+ # Delete the PortingPortInInstance
252
+ # @return [Boolean] True if delete succeeds, false otherwise
253
+ def delete
254
+
255
+ context.delete
256
+ end
257
+
258
+ ##
259
+ # Fetch the PortingPortInInstance
260
+ # @return [PortingPortInInstance] Fetched PortingPortInInstance
261
+ def fetch
262
+
263
+ context.fetch
264
+ end
265
+
118
266
  ##
119
267
  # Provide a user friendly representation
120
268
  def to_s
121
- "<Twilio.Numbers.V1.PortingPortInInstance>"
269
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
270
+ "<Twilio.Numbers.V1.PortingPortInInstance #{values}>"
122
271
  end
123
272
 
124
273
  ##
125
274
  # Provide a detailed, user friendly representation
126
275
  def inspect
127
- "<Twilio.Numbers.V1.PortingPortInInstance>"
276
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
277
+ "<Twilio.Numbers.V1.PortingPortInInstance #{values}>"
128
278
  end
129
279
  end
130
280
 
@@ -0,0 +1,292 @@
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 V1 < Version
20
+ class PortingPortInPhoneNumberList < ListResource
21
+
22
+ ##
23
+ # Initialize the PortingPortInPhoneNumberList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [PortingPortInPhoneNumberList] PortingPortInPhoneNumberList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+
31
+
32
+ end
33
+
34
+
35
+
36
+ # Provide a user friendly representation
37
+ def to_s
38
+ '#<Twilio.Numbers.V1.PortingPortInPhoneNumberList>'
39
+ end
40
+ end
41
+
42
+
43
+ class PortingPortInPhoneNumberContext < InstanceContext
44
+ ##
45
+ # Initialize the PortingPortInPhoneNumberContext
46
+ # @param [Version] version Version that contains the resource
47
+ # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request.
48
+ # @param [String] phone_number_sid The SID of the Phone number. This is a unique identifier of the phone number.
49
+ # @return [PortingPortInPhoneNumberContext] PortingPortInPhoneNumberContext
50
+ def initialize(version, port_in_request_sid, phone_number_sid)
51
+ super(version)
52
+
53
+ # Path Solution
54
+ @solution = { port_in_request_sid: port_in_request_sid, phone_number_sid: phone_number_sid, }
55
+ @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}/PhoneNumber/#{@solution[:phone_number_sid]}"
56
+
57
+
58
+ end
59
+ ##
60
+ # Delete the PortingPortInPhoneNumberInstance
61
+ # @return [Boolean] True if delete succeeds, false otherwise
62
+ def delete
63
+
64
+
65
+ @version.delete('DELETE', @uri)
66
+ end
67
+
68
+ ##
69
+ # Fetch the PortingPortInPhoneNumberInstance
70
+ # @return [PortingPortInPhoneNumberInstance] Fetched PortingPortInPhoneNumberInstance
71
+ def fetch
72
+
73
+
74
+ payload = @version.fetch('GET', @uri)
75
+ PortingPortInPhoneNumberInstance.new(
76
+ @version,
77
+ payload,
78
+ port_in_request_sid: @solution[:port_in_request_sid],
79
+ phone_number_sid: @solution[:phone_number_sid],
80
+ )
81
+ end
82
+
83
+
84
+ ##
85
+ # Provide a user friendly representation
86
+ def to_s
87
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
88
+ "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>"
89
+ end
90
+
91
+ ##
92
+ # Provide a detailed, user friendly representation
93
+ def inspect
94
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
95
+ "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>"
96
+ end
97
+ end
98
+
99
+ class PortingPortInPhoneNumberPage < Page
100
+ ##
101
+ # Initialize the PortingPortInPhoneNumberPage
102
+ # @param [Version] version Version that contains the resource
103
+ # @param [Response] response Response from the API
104
+ # @param [Hash] solution Path solution for the resource
105
+ # @return [PortingPortInPhoneNumberPage] PortingPortInPhoneNumberPage
106
+ def initialize(version, response, solution)
107
+ super(version, response)
108
+
109
+ # Path Solution
110
+ @solution = solution
111
+ end
112
+
113
+ ##
114
+ # Build an instance of PortingPortInPhoneNumberInstance
115
+ # @param [Hash] payload Payload response from the API
116
+ # @return [PortingPortInPhoneNumberInstance] PortingPortInPhoneNumberInstance
117
+ def get_instance(payload)
118
+ PortingPortInPhoneNumberInstance.new(@version, payload)
119
+ end
120
+
121
+ ##
122
+ # Provide a user friendly representation
123
+ def to_s
124
+ '<Twilio.Numbers.V1.PortingPortInPhoneNumberPage>'
125
+ end
126
+ end
127
+ class PortingPortInPhoneNumberInstance < InstanceResource
128
+ ##
129
+ # Initialize the PortingPortInPhoneNumberInstance
130
+ # @param [Version] version Version that contains the resource
131
+ # @param [Hash] payload payload that contains response from Twilio
132
+ # @param [String] account_sid The SID of the
133
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingPortInPhoneNumber
134
+ # resource.
135
+ # @param [String] sid The SID of the Call resource to fetch.
136
+ # @return [PortingPortInPhoneNumberInstance] PortingPortInPhoneNumberInstance
137
+ def initialize(version, payload , port_in_request_sid: nil, phone_number_sid: nil)
138
+ super(version)
139
+
140
+ # Marshaled Properties
141
+ @properties = {
142
+ 'port_in_request_sid' => payload['port_in_request_sid'],
143
+ 'phone_number_sid' => payload['phone_number_sid'],
144
+ 'url' => payload['url'],
145
+ 'account_sid' => payload['account_sid'],
146
+ 'phone_number_type' => payload['phone_number_type'],
147
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
148
+ 'country' => payload['country'],
149
+ 'missing_required_fields' => payload['missing_required_fields'],
150
+ 'status_last_time_updated_timestamp' => Twilio.deserialize_iso8601_datetime(payload['status_last_time_updated_timestamp']),
151
+ 'phone_number' => payload['phone_number'],
152
+ 'portable' => payload['portable'],
153
+ 'not_portability_reason' => payload['not_portability_reason'],
154
+ 'not_portability_reason_code' => payload['not_portability_reason_code'],
155
+ 'port_in_phone_number_status' => payload['port_in_phone_number_status'],
156
+ }
157
+
158
+ # Context
159
+ @instance_context = nil
160
+ @params = { 'port_in_request_sid' => port_in_request_sid || @properties['port_in_request_sid'] ,'phone_number_sid' => phone_number_sid || @properties['phone_number_sid'] , }
161
+ end
162
+
163
+ ##
164
+ # Generate an instance context for the instance, the context is capable of
165
+ # performing various actions. All instance actions are proxied to the context
166
+ # @return [PortingPortInPhoneNumberContext] CallContext for this CallInstance
167
+ def context
168
+ unless @instance_context
169
+ @instance_context = PortingPortInPhoneNumberContext.new(@version , @params['port_in_request_sid'], @params['phone_number_sid'])
170
+ end
171
+ @instance_context
172
+ end
173
+
174
+ ##
175
+ # @return [String] The SID of the Port In request. This is a unique identifier of the port in request.
176
+ def port_in_request_sid
177
+ @properties['port_in_request_sid']
178
+ end
179
+
180
+ ##
181
+ # @return [String] The SID of the Port In request phone number. This is a unique identifier of the phone number.
182
+ def phone_number_sid
183
+ @properties['phone_number_sid']
184
+ end
185
+
186
+ ##
187
+ # @return [String]
188
+ def url
189
+ @properties['url']
190
+ end
191
+
192
+ ##
193
+ # @return [String] The SID of the account that the phone number belongs to.
194
+ def account_sid
195
+ @properties['account_sid']
196
+ end
197
+
198
+ ##
199
+ # @return [String] The type of the phone number.
200
+ def phone_number_type
201
+ @properties['phone_number_type']
202
+ end
203
+
204
+ ##
205
+ # @return [Time] The date when the phone number was created.
206
+ def date_created
207
+ @properties['date_created']
208
+ end
209
+
210
+ ##
211
+ # @return [String] The country of the phone number.
212
+ def country
213
+ @properties['country']
214
+ end
215
+
216
+ ##
217
+ # @return [Boolean] The phone number is missing required fields.
218
+ def missing_required_fields
219
+ @properties['missing_required_fields']
220
+ end
221
+
222
+ ##
223
+ # @return [Time] The timestamp when the status was last updated.
224
+ def status_last_time_updated_timestamp
225
+ @properties['status_last_time_updated_timestamp']
226
+ end
227
+
228
+ ##
229
+ # @return [String] The phone number.
230
+ def phone_number
231
+ @properties['phone_number']
232
+ end
233
+
234
+ ##
235
+ # @return [Boolean] The phone number is portable.
236
+ def portable
237
+ @properties['portable']
238
+ end
239
+
240
+ ##
241
+ # @return [String] The reason why the phone number is not portable.
242
+ def not_portability_reason
243
+ @properties['not_portability_reason']
244
+ end
245
+
246
+ ##
247
+ # @return [String] The code of the reason why the phone number is not portable.
248
+ def not_portability_reason_code
249
+ @properties['not_portability_reason_code']
250
+ end
251
+
252
+ ##
253
+ # @return [String] The status of the phone number in the port in request.
254
+ def port_in_phone_number_status
255
+ @properties['port_in_phone_number_status']
256
+ end
257
+
258
+ ##
259
+ # Delete the PortingPortInPhoneNumberInstance
260
+ # @return [Boolean] True if delete succeeds, false otherwise
261
+ def delete
262
+
263
+ context.delete
264
+ end
265
+
266
+ ##
267
+ # Fetch the PortingPortInPhoneNumberInstance
268
+ # @return [PortingPortInPhoneNumberInstance] Fetched PortingPortInPhoneNumberInstance
269
+ def fetch
270
+
271
+ context.fetch
272
+ end
273
+
274
+ ##
275
+ # Provide a user friendly representation
276
+ def to_s
277
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
278
+ "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
279
+ end
280
+
281
+ ##
282
+ # Provide a detailed, user friendly representation
283
+ def inspect
284
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
285
+ "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
286
+ end
287
+ end
288
+
289
+ end
290
+ end
291
+ end
292
+ end
@@ -0,0 +1,148 @@
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 V1 < Version
20
+ class PortingWebhookConfigurationList < ListResource
21
+
22
+ ##
23
+ # Initialize the PortingWebhookConfigurationList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [PortingWebhookConfigurationList] PortingWebhookConfigurationList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/Porting/Configuration/Webhook"
31
+
32
+ end
33
+ ##
34
+ # Create the PortingWebhookConfigurationInstance
35
+ # @param [Object] body
36
+ # @return [PortingWebhookConfigurationInstance] Created PortingWebhookConfigurationInstance
37
+ def create(body: :unset
38
+ )
39
+
40
+ headers = Twilio::Values.of({"Content-Type"=> "application/json"})
41
+ payload = @version.create('POST', @uri, data: body.to_json, headers: headers)
42
+ PortingWebhookConfigurationInstance.new(
43
+ @version,
44
+ payload,
45
+ )
46
+ end
47
+
48
+
49
+
50
+
51
+ # Provide a user friendly representation
52
+ def to_s
53
+ '#<Twilio.Numbers.V1.PortingWebhookConfigurationList>'
54
+ end
55
+ end
56
+
57
+ class PortingWebhookConfigurationPage < Page
58
+ ##
59
+ # Initialize the PortingWebhookConfigurationPage
60
+ # @param [Version] version Version that contains the resource
61
+ # @param [Response] response Response from the API
62
+ # @param [Hash] solution Path solution for the resource
63
+ # @return [PortingWebhookConfigurationPage] PortingWebhookConfigurationPage
64
+ def initialize(version, response, solution)
65
+ super(version, response)
66
+
67
+ # Path Solution
68
+ @solution = solution
69
+ end
70
+
71
+ ##
72
+ # Build an instance of PortingWebhookConfigurationInstance
73
+ # @param [Hash] payload Payload response from the API
74
+ # @return [PortingWebhookConfigurationInstance] PortingWebhookConfigurationInstance
75
+ def get_instance(payload)
76
+ PortingWebhookConfigurationInstance.new(@version, payload)
77
+ end
78
+
79
+ ##
80
+ # Provide a user friendly representation
81
+ def to_s
82
+ '<Twilio.Numbers.V1.PortingWebhookConfigurationPage>'
83
+ end
84
+ end
85
+ class PortingWebhookConfigurationInstance < InstanceResource
86
+ ##
87
+ # Initialize the PortingWebhookConfigurationInstance
88
+ # @param [Version] version Version that contains the resource
89
+ # @param [Hash] payload payload that contains response from Twilio
90
+ # @param [String] account_sid The SID of the
91
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingWebhookConfiguration
92
+ # resource.
93
+ # @param [String] sid The SID of the Call resource to fetch.
94
+ # @return [PortingWebhookConfigurationInstance] PortingWebhookConfigurationInstance
95
+ def initialize(version, payload )
96
+ super(version)
97
+
98
+ # Marshaled Properties
99
+ @properties = {
100
+ 'url' => payload['url'],
101
+ 'port_in_target_url' => payload['port_in_target_url'],
102
+ 'port_out_target_url' => payload['port_out_target_url'],
103
+ 'notifications_of' => payload['notifications_of'],
104
+ }
105
+ end
106
+
107
+
108
+ ##
109
+ # @return [String] The URL of the webhook configuration request
110
+ def url
111
+ @properties['url']
112
+ end
113
+
114
+ ##
115
+ # @return [String] Webhook URL to send a request when a port in request or port in phone number event happens
116
+ def port_in_target_url
117
+ @properties['port_in_target_url']
118
+ end
119
+
120
+ ##
121
+ # @return [String] Webhook URL to send a request when a port out phone number event happens
122
+ def port_out_target_url
123
+ @properties['port_out_target_url']
124
+ end
125
+
126
+ ##
127
+ # @return [Array<String>] List of notification events to send a request to the webhook URL
128
+ def notifications_of
129
+ @properties['notifications_of']
130
+ end
131
+
132
+ ##
133
+ # Provide a user friendly representation
134
+ def to_s
135
+ "<Twilio.Numbers.V1.PortingWebhookConfigurationInstance>"
136
+ end
137
+
138
+ ##
139
+ # Provide a detailed, user friendly representation
140
+ def inspect
141
+ "<Twilio.Numbers.V1.PortingWebhookConfigurationInstance>"
142
+ end
143
+ end
144
+
145
+ end
146
+ end
147
+ end
148
+ end