twilio-ruby 7.2.1 → 7.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +74 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +5 -599
  5. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb +200 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +22 -1
  8. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +303 -0
  9. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +626 -0
  10. data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +229 -0
  11. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +593 -0
  12. data/lib/twilio-ruby/rest/assistants/v1/policy.rb +264 -0
  13. data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +264 -0
  14. data/lib/twilio-ruby/rest/assistants/v1/session.rb +328 -0
  15. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +549 -0
  16. data/lib/twilio-ruby/rest/assistants/v1.rb +100 -0
  17. data/lib/twilio-ruby/rest/{preview_iam.rb → assistants.rb} +1 -1
  18. data/lib/twilio-ruby/rest/assistants_base.rb +38 -0
  19. data/lib/twilio-ruby/rest/client.rb +8 -3
  20. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +11 -11
  21. data/lib/twilio-ruby/rest/content/v1/content.rb +167 -4
  22. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +81 -1
  23. data/lib/twilio-ruby/rest/iam/v1/api_key.rb +270 -0
  24. data/lib/twilio-ruby/rest/iam/v1/get_api_keys.rb +223 -0
  25. data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +177 -0
  26. data/lib/twilio-ruby/rest/iam/v1.rb +61 -0
  27. data/lib/twilio-ruby/rest/iam.rb +6 -0
  28. data/lib/twilio-ruby/rest/{preview_iam_base.rb → iam_base.rb} +10 -5
  29. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +60 -12
  30. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +1 -1
  31. data/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb +16 -3
  32. data/lib/twilio-ruby/rest/intelligence/v2.rb +1 -1
  33. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +16 -29
  34. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +46 -20
  35. data/lib/twilio-ruby/rest/marketplace/v1/referral_conversion.rb +199 -0
  36. data/lib/twilio-ruby/rest/marketplace/v1.rb +7 -1
  37. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +4 -1
  38. data/lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb +40 -0
  39. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +10 -10
  40. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +24 -17
  41. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +7 -7
  42. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +3 -3
  43. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +1 -1
  44. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +3 -3
  45. data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +96 -0
  46. data/lib/twilio-ruby/rest/numbers/v1.rb +2 -2
  47. data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +277 -0
  48. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +8 -5
  49. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  50. data/lib/twilio-ruby/rest/numbers/v2.rb +15 -0
  51. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +2 -2
  52. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
  53. data/lib/twilio-ruby/rest/trusthub/v1/compliance_inquiries.rb +12 -3
  54. data/lib/twilio-ruby/rest/verify/v2/service.rb +4 -4
  55. data/lib/twilio-ruby/version.rb +1 -1
  56. data/twilio-ruby.gemspec +2 -1
  57. metadata +23 -4
@@ -158,6 +158,7 @@ module Twilio
158
158
  'port_out_pin' => payload['port_out_pin'] == nil ? payload['port_out_pin'] : payload['port_out_pin'].to_i,
159
159
  'rejection_reason' => payload['rejection_reason'],
160
160
  'rejection_reason_code' => payload['rejection_reason_code'] == nil ? payload['rejection_reason_code'] : payload['rejection_reason_code'].to_i,
161
+ 'port_date' => Twilio.deserialize_iso8601_datetime(payload['port_date']),
161
162
  }
162
163
 
163
164
  # Context
@@ -177,107 +178,113 @@ module Twilio
177
178
  end
178
179
 
179
180
  ##
180
- # @return [String] The SID of the Port In request. This is a unique identifier of the port in request.
181
+ # @return [String] The unique identifier for the port in request that this phone number is associated with.
181
182
  def port_in_request_sid
182
183
  @properties['port_in_request_sid']
183
184
  end
184
185
 
185
186
  ##
186
- # @return [String] The SID of the Port In request phone number. This is a unique identifier of the phone number.
187
+ # @return [String] The unique identifier for this phone number associated with this port in request.
187
188
  def phone_number_sid
188
189
  @properties['phone_number_sid']
189
190
  end
190
191
 
191
192
  ##
192
- # @return [String]
193
+ # @return [String] URL reference for this resource.
193
194
  def url
194
195
  @properties['url']
195
196
  end
196
197
 
197
198
  ##
198
- # @return [String] The SID of the account that the phone number belongs to.
199
+ # @return [String] Account Sid or subaccount where the phone number(s) will be Ported.
199
200
  def account_sid
200
201
  @properties['account_sid']
201
202
  end
202
203
 
203
204
  ##
204
- # @return [String] The type of the phone number.
205
+ # @return [String] The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
205
206
  def phone_number_type
206
207
  @properties['phone_number_type']
207
208
  end
208
209
 
209
210
  ##
210
- # @return [Time] The date when the phone number was created.
211
+ # @return [Time] The timestamp for when this port in phone number was created.
211
212
  def date_created
212
213
  @properties['date_created']
213
214
  end
214
215
 
215
216
  ##
216
- # @return [String] The country of the phone number.
217
+ # @return [String] The ISO country code that this number is associated with. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
217
218
  def country
218
219
  @properties['country']
219
220
  end
220
221
 
221
222
  ##
222
- # @return [Boolean] The phone number is missing required fields.
223
+ # @return [Boolean] Indicates if the phone number is missing required fields such as a PIN or account number. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.
223
224
  def missing_required_fields
224
225
  @properties['missing_required_fields']
225
226
  end
226
227
 
227
228
  ##
228
- # @return [Time] The timestamp when the status was last updated.
229
+ # @return [Time] Timestamp indicating when the Port In Phone Number resource was last modified.
229
230
  def last_updated
230
231
  @properties['last_updated']
231
232
  end
232
233
 
233
234
  ##
234
- # @return [String] The phone number.
235
+ # @return [String] Phone number to be ported. This will be in the E164 Format.
235
236
  def phone_number
236
237
  @properties['phone_number']
237
238
  end
238
239
 
239
240
  ##
240
- # @return [Boolean] The phone number is portable.
241
+ # @return [Boolean] If the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the `not_portability_reason_code` and `not_portability_reason` fields for more details
241
242
  def portable
242
243
  @properties['portable']
243
244
  end
244
245
 
245
246
  ##
246
- # @return [String] The reason why the phone number is not portable.
247
+ # @return [String] The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
247
248
  def not_portability_reason
248
249
  @properties['not_portability_reason']
249
250
  end
250
251
 
251
252
  ##
252
- # @return [String] The code of the reason why the phone number is not portable.
253
+ # @return [String] The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.
253
254
  def not_portability_reason_code
254
255
  @properties['not_portability_reason_code']
255
256
  end
256
257
 
257
258
  ##
258
- # @return [String] The status of the phone number in the port in request.
259
+ # @return [String] The status of the port in phone number.
259
260
  def port_in_phone_number_status
260
261
  @properties['port_in_phone_number_status']
261
262
  end
262
263
 
263
264
  ##
264
- # @return [String] The pin required for the losing carrier to port out the phone number.
265
+ # @return [String] The pin required by the losing carrier to do the port out.
265
266
  def port_out_pin
266
267
  @properties['port_out_pin']
267
268
  end
268
269
 
269
270
  ##
270
- # @return [String] The rejection reason returned by the vendor.
271
+ # @return [String] The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
271
272
  def rejection_reason
272
273
  @properties['rejection_reason']
273
274
  end
274
275
 
275
276
  ##
276
- # @return [String] The rejection reason code returned by the vendor.
277
+ # @return [String] The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.
277
278
  def rejection_reason_code
278
279
  @properties['rejection_reason_code']
279
280
  end
280
281
 
282
+ ##
283
+ # @return [Time] The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed.
284
+ def port_date
285
+ @properties['port_date']
286
+ end
287
+
281
288
  ##
282
289
  # Delete the PortingPortInPhoneNumberInstance
283
290
  # @return [Boolean] True if delete succeeds, false otherwise
@@ -44,7 +44,7 @@ module Twilio
44
44
  ##
45
45
  # Initialize the PortingPortabilityContext
46
46
  # @param [Version] version Version that contains the resource
47
- # @param [String] phone_number The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
47
+ # @param [String] phone_number Phone number to check portability in e164 format.
48
48
  # @return [PortingPortabilityContext] PortingPortabilityContext
49
49
  def initialize(version, phone_number)
50
50
  super(version)
@@ -57,7 +57,7 @@ module Twilio
57
57
  end
58
58
  ##
59
59
  # Fetch the PortingPortabilityInstance
60
- # @param [String] target_account_sid The SID of the account where the phone number(s) will be ported.
60
+ # @param [String] target_account_sid Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
61
61
  # @return [PortingPortabilityInstance] Fetched PortingPortabilityInstance
62
62
  def fetch(
63
63
  target_account_sid: :unset
@@ -169,19 +169,19 @@ module Twilio
169
169
  end
170
170
 
171
171
  ##
172
- # @return [String] The target account sid to which the number will be ported
172
+ # @return [String] Account Sid that the phone number belongs to in Twilio. This is only returned for phone numbers that already exist in Twilio’s inventory and belong to your account or sub account.
173
173
  def account_sid
174
174
  @properties['account_sid']
175
175
  end
176
176
 
177
177
  ##
178
- # @return [Boolean] Boolean flag specifying if phone number is portable or not.
178
+ # @return [Boolean] Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not.
179
179
  def portable
180
180
  @properties['portable']
181
181
  end
182
182
 
183
183
  ##
184
- # @return [Boolean] Boolean flag specifying if PIN and account number is required for the phone number.
184
+ # @return [Boolean] Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number. If this is true you will be required to submit both a PIN and account number from the losing carrier for this number when opening a port in request. These fields will be required in order to complete the port in process to Twilio.
185
185
  def pin_and_account_number_required
186
186
  @properties['pin_and_account_number_required']
187
187
  end
@@ -193,7 +193,7 @@ module Twilio
193
193
  end
194
194
 
195
195
  ##
196
- # @return [String] The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`.
196
+ # @return [String] The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise.
197
197
  def not_portable_reason_code
198
198
  @properties['not_portable_reason_code']
199
199
  end
@@ -218,7 +218,7 @@ module Twilio
218
218
 
219
219
  ##
220
220
  # Fetch the PortingPortabilityInstance
221
- # @param [String] target_account_sid The SID of the account where the phone number(s) will be ported.
221
+ # @param [String] target_account_sid Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
222
222
  # @return [PortingPortabilityInstance] Fetched PortingPortabilityInstance
223
223
  def fetch(
224
224
  target_account_sid: :unset
@@ -113,19 +113,19 @@ module Twilio
113
113
  end
114
114
 
115
115
  ##
116
- # @return [String] Webhook URL to send a request when a port in request or port in phone number event happens
116
+ # @return [String] The complete webhook url that will be called when a notification event for port in request or port in phone number happens
117
117
  def port_in_target_url
118
118
  @properties['port_in_target_url']
119
119
  end
120
120
 
121
121
  ##
122
- # @return [String] Webhook URL to send a request when a port out phone number event happens
122
+ # @return [String] The complete webhook url that will be called when a notification event for a port out phone number happens.
123
123
  def port_out_target_url
124
124
  @properties['port_out_target_url']
125
125
  end
126
126
 
127
127
  ##
128
- # @return [Array<String>] List of notification events to send a request to the webhook URL
128
+ # @return [Array<String>] A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.
129
129
  def notifications_of
130
130
  @properties['notifications_of']
131
131
  end
@@ -44,7 +44,7 @@ module Twilio
44
44
  ##
45
45
  # Initialize the PortingWebhookConfigurationDeleteContext
46
46
  # @param [Version] version Version that contains the resource
47
- # @param [WebhookType] webhook_type The of the webhook type of the configuration to be deleted
47
+ # @param [WebhookType] webhook_type The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT`
48
48
  # @return [PortingWebhookConfigurationDeleteContext] PortingWebhookConfigurationDeleteContext
49
49
  def initialize(version, webhook_type)
50
50
  super(version)
@@ -113,19 +113,19 @@ module Twilio
113
113
  end
114
114
 
115
115
  ##
116
- # @return [String] Webhook URL to send a request when a port in request or port in phone number event happens
116
+ # @return [String] The complete webhook url that will be called when a notification event for port in request or port in phone number happens
117
117
  def port_in_target_url
118
118
  @properties['port_in_target_url']
119
119
  end
120
120
 
121
121
  ##
122
- # @return [String] Webhook URL to send a request when a port out phone number event happens
122
+ # @return [String] The complete webhook url that will be called when a notification event for a port out phone number happens.
123
123
  def port_out_target_url
124
124
  @properties['port_out_target_url']
125
125
  end
126
126
 
127
127
  ##
128
- # @return [Array<String>] List of notification events to send a request to the webhook URL
128
+ # @return [Array<String>] A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.
129
129
  def notifications_of
130
130
  @properties['notifications_of']
131
131
  end
@@ -47,6 +47,102 @@ module Twilio
47
47
  end
48
48
 
49
49
 
50
+ ##
51
+ # Lists SigningRequestConfigurationInstance records from the API as a list.
52
+ # Unlike stream(), this operation is eager and will load `limit` records into
53
+ # memory before returning.
54
+ # @param [String] country The country ISO code to apply this configuration, this is an optional field, Example: US, MX
55
+ # @param [String] product The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting
56
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
57
+ # guarantees to never return more than limit. Default is no limit
58
+ # @param [Integer] page_size Number of records to fetch per request, when
59
+ # not set will use the default value of 50 records. If no page_size is defined
60
+ # but a limit is defined, stream() will attempt to read the limit with the most
61
+ # efficient page size, i.e. min(limit, 1000)
62
+ # @return [Array] Array of up to limit results
63
+ def list(country: :unset, product: :unset, limit: nil, page_size: nil)
64
+ self.stream(
65
+ country: country,
66
+ product: product,
67
+ limit: limit,
68
+ page_size: page_size
69
+ ).entries
70
+ end
71
+
72
+ ##
73
+ # Streams Instance records from the API as an Enumerable.
74
+ # This operation lazily loads records as efficiently as possible until the limit
75
+ # is reached.
76
+ # @param [String] country The country ISO code to apply this configuration, this is an optional field, Example: US, MX
77
+ # @param [String] product The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting
78
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
79
+ # guarantees to never return more than limit. Default is no limit
80
+ # @param [Integer] page_size Number of records to fetch per request, when
81
+ # not set will use the default value of 50 records. If no page_size is defined
82
+ # but a limit is defined, stream() will attempt to read the limit with the most
83
+ # efficient page size, i.e. min(limit, 1000)
84
+ # @return [Enumerable] Enumerable that will yield up to limit results
85
+ def stream(country: :unset, product: :unset, limit: nil, page_size: nil)
86
+ limits = @version.read_limits(limit, page_size)
87
+
88
+ page = self.page(
89
+ country: country,
90
+ product: product,
91
+ page_size: limits[:page_size], )
92
+
93
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
94
+ end
95
+
96
+ ##
97
+ # When passed a block, yields SigningRequestConfigurationInstance records from the API.
98
+ # This operation lazily loads records as efficiently as possible until the limit
99
+ # is reached.
100
+ def each
101
+ limits = @version.read_limits
102
+
103
+ page = self.page(page_size: limits[:page_size], )
104
+
105
+ @version.stream(page,
106
+ limit: limits[:limit],
107
+ page_limit: limits[:page_limit]).each {|x| yield x}
108
+ end
109
+
110
+ ##
111
+ # Retrieve a single page of SigningRequestConfigurationInstance records from the API.
112
+ # Request is executed immediately.
113
+ # @param [String] country The country ISO code to apply this configuration, this is an optional field, Example: US, MX
114
+ # @param [String] product The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting
115
+ # @param [String] page_token PageToken provided by the API
116
+ # @param [Integer] page_number Page Number, this value is simply for client state
117
+ # @param [Integer] page_size Number of records to return, defaults to 50
118
+ # @return [Page] Page of SigningRequestConfigurationInstance
119
+ def page(country: :unset, product: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
120
+ params = Twilio::Values.of({
121
+ 'Country' => country,
122
+ 'Product' => product,
123
+ 'PageToken' => page_token,
124
+ 'Page' => page_number,
125
+ 'PageSize' => page_size,
126
+ })
127
+
128
+ response = @version.page('GET', @uri, params: params)
129
+
130
+ SigningRequestConfigurationPage.new(@version, response, @solution)
131
+ end
132
+
133
+ ##
134
+ # Retrieve a single page of SigningRequestConfigurationInstance records from the API.
135
+ # Request is executed immediately.
136
+ # @param [String] target_url API-generated URL for the requested results page
137
+ # @return [Page] Page of SigningRequestConfigurationInstance
138
+ def get_page(target_url)
139
+ response = @version.domain.request(
140
+ 'GET',
141
+ target_url
142
+ )
143
+ SigningRequestConfigurationPage.new(@version, response, @solution)
144
+ end
145
+
50
146
 
51
147
 
52
148
  # Provide a user friendly representation
@@ -102,7 +102,7 @@ module Twilio
102
102
  end
103
103
  end
104
104
  ##
105
- # @param [String] phone_number The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
105
+ # @param [String] phone_number Phone number to check portability in e164 format.
106
106
  # @return [Twilio::REST::Numbers::V1::PortingPortabilityContext] if phoneNumber was passed.
107
107
  # @return [Twilio::REST::Numbers::V1::PortingPortabilityList]
108
108
  def porting_portabilities(phone_number=:unset)
@@ -121,7 +121,7 @@ module Twilio
121
121
  @porting_webhook_configurations ||= PortingWebhookConfigurationList.new self
122
122
  end
123
123
  ##
124
- # @param [String] webhook_type The of the webhook type of the configuration to be deleted
124
+ # @param [String] webhook_type The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT`
125
125
  # @return [Twilio::REST::Numbers::V1::PortingWebhookConfigurationDeleteContext] if webhookType was passed.
126
126
  # @return [Twilio::REST::Numbers::V1::PortingWebhookConfigurationDeleteList]
127
127
  def porting_webhook_configurations_delete(webhook_type=:unset)