twilio-ruby 7.10.6 → 7.11.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.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-deploy.yml +43 -67
- data/.gitignore +0 -1
- data/CHANGES.md +57 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +154 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +507 -0
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
- data/lib/twilio-ruby/rest/conversations/v2.rb +61 -45
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
- data/lib/twilio-ruby/rest/iam_base.rb +6 -1
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
- data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
- data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
- data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
- data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
- data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
- data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/profile.rb +87 -2
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/store.rb +46 -1
- data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
- data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
- data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
- data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
- data/lib/twilio-ruby/rest/routes_base.rb +6 -1
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
- data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
- data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
- data/lib/twilio-ruby/rest/voice_base.rb +5 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +34 -21
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
- data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
- data/lib/twilio-ruby/rest/assistants.rb +0 -6
- data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
5
|
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
6
|
#
|
|
7
|
-
# Twilio -
|
|
7
|
+
# Twilio - Numbers
|
|
8
8
|
# This is the public Twilio REST API.
|
|
9
9
|
#
|
|
10
10
|
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
|
|
16
16
|
module Twilio
|
|
17
17
|
module REST
|
|
18
|
-
class
|
|
19
|
-
class
|
|
20
|
-
class
|
|
18
|
+
class Numbers < NumbersBase
|
|
19
|
+
class V2 < Version
|
|
20
|
+
class CallerIdList < ListResource
|
|
21
21
|
|
|
22
22
|
##
|
|
23
|
-
# Initialize the
|
|
23
|
+
# Initialize the CallerIdList
|
|
24
24
|
# @param [Version] version Version that contains the resource
|
|
25
|
-
# @return [
|
|
25
|
+
# @return [CallerIdList] CallerIdList
|
|
26
26
|
def initialize(version)
|
|
27
27
|
super(version)
|
|
28
28
|
|
|
29
29
|
# Path Solution
|
|
30
30
|
@solution = { }
|
|
31
|
-
@uri = "/
|
|
31
|
+
@uri = "/CallerIds"
|
|
32
32
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
##
|
|
36
|
-
# Lists
|
|
36
|
+
# Lists CallerIdInstance records from the API as a list.
|
|
37
37
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
38
38
|
# memory before returning.
|
|
39
39
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
@@ -75,7 +75,7 @@ module Twilio
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
##
|
|
78
|
-
# Lists
|
|
78
|
+
# Lists CallerIdPageMetadata records from the API as a list.
|
|
79
79
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
80
80
|
# guarantees to never return more than limit. Default is no limit
|
|
81
81
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -93,11 +93,11 @@ module Twilio
|
|
|
93
93
|
|
|
94
94
|
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
CallerIdPageMetadata.new(@version, response, @solution, limits[:limit])
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
##
|
|
100
|
-
# When passed a block, yields
|
|
100
|
+
# When passed a block, yields CallerIdInstance records from the API.
|
|
101
101
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
102
102
|
# is reached.
|
|
103
103
|
def each
|
|
@@ -115,12 +115,12 @@ module Twilio
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
##
|
|
118
|
-
# Retrieve a single page of
|
|
118
|
+
# Retrieve a single page of CallerIdInstance records from the API.
|
|
119
119
|
# Request is executed immediately.
|
|
120
120
|
# @param [String] page_token PageToken provided by the API
|
|
121
121
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
122
122
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
123
|
-
# @return [Page] Page of
|
|
123
|
+
# @return [Page] Page of CallerIdInstance
|
|
124
124
|
def page(page_token: :unset, page_number: :unset,page_size: :unset)
|
|
125
125
|
params = Twilio::Values.of({
|
|
126
126
|
'PageToken' => page_token,
|
|
@@ -133,71 +133,102 @@ module Twilio
|
|
|
133
133
|
|
|
134
134
|
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
CallerIdPage.new(@version, response, @solution)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
##
|
|
140
|
-
# Retrieve a single page of
|
|
140
|
+
# Retrieve a single page of CallerIdInstance records from the API.
|
|
141
141
|
# Request is executed immediately.
|
|
142
142
|
# @param [String] target_url API-generated URL for the requested results page
|
|
143
|
-
# @return [Page] Page of
|
|
143
|
+
# @return [Page] Page of CallerIdInstance
|
|
144
144
|
def get_page(target_url)
|
|
145
145
|
response = @version.domain.request(
|
|
146
146
|
'GET',
|
|
147
147
|
target_url
|
|
148
148
|
)
|
|
149
|
-
|
|
149
|
+
CallerIdPage.new(@version, response, @solution)
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
# Provide a user friendly representation
|
|
155
155
|
def to_s
|
|
156
|
-
'#<Twilio.
|
|
156
|
+
'#<Twilio.Numbers.V2.CallerIdList>'
|
|
157
157
|
end
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
class
|
|
161
|
+
class CallerIdContext < InstanceContext
|
|
162
162
|
##
|
|
163
|
-
# Initialize the
|
|
163
|
+
# Initialize the CallerIdContext
|
|
164
164
|
# @param [Version] version Version that contains the resource
|
|
165
|
-
# @param [String]
|
|
166
|
-
# @return [
|
|
167
|
-
def initialize(version,
|
|
165
|
+
# @param [String] caller_id_sid
|
|
166
|
+
# @return [CallerIdContext] CallerIdContext
|
|
167
|
+
def initialize(version, caller_id_sid)
|
|
168
168
|
super(version)
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
# Path Solution
|
|
172
|
-
@solution = {
|
|
173
|
-
@uri = "/
|
|
172
|
+
@solution = { caller_id_sid: caller_id_sid, }
|
|
173
|
+
@uri = "/CallerIds/#{@solution[:caller_id_sid]}"
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
@messages = nil
|
|
175
|
+
|
|
177
176
|
end
|
|
178
177
|
##
|
|
179
|
-
#
|
|
180
|
-
# @return [
|
|
181
|
-
def
|
|
178
|
+
# Delete the CallerIdInstance
|
|
179
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
180
|
+
def delete
|
|
182
181
|
|
|
183
182
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
184
183
|
|
|
185
184
|
|
|
186
185
|
|
|
186
|
+
|
|
187
|
+
@version.delete('DELETE', @uri, headers: headers)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
##
|
|
191
|
+
# Delete the CallerIdInstanceMetadata
|
|
192
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
193
|
+
def delete_with_metadata
|
|
194
|
+
|
|
195
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
187
196
|
|
|
188
197
|
|
|
189
|
-
|
|
190
|
-
|
|
198
|
+
|
|
199
|
+
response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
|
|
200
|
+
callerId_instance = CallerIdInstance.new(
|
|
201
|
+
@version,
|
|
202
|
+
response.body,
|
|
203
|
+
account_sid: @solution[:account_sid],
|
|
204
|
+
sid: @solution[:sid],
|
|
205
|
+
)
|
|
206
|
+
CallerIdInstanceMetadata.new(@version, callerId_instance, response.headers, response.status_code)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
##
|
|
210
|
+
# Update the CallerIdInstance
|
|
211
|
+
# @return [CallerIdInstance] Updated CallerIdInstance
|
|
212
|
+
def update
|
|
213
|
+
|
|
214
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
payload = @version.update('POST', @uri, headers: headers)
|
|
221
|
+
CallerIdInstance.new(
|
|
191
222
|
@version,
|
|
192
223
|
payload,
|
|
193
|
-
|
|
224
|
+
caller_id_sid: @solution[:caller_id_sid],
|
|
194
225
|
)
|
|
195
226
|
end
|
|
196
227
|
|
|
197
228
|
##
|
|
198
|
-
#
|
|
199
|
-
# @return [
|
|
200
|
-
def
|
|
229
|
+
# Update the CallerIdInstanceMetadata
|
|
230
|
+
# @return [CallerIdInstance] Updated CallerIdInstance
|
|
231
|
+
def update_with_metadata
|
|
201
232
|
|
|
202
233
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
203
234
|
|
|
@@ -205,62 +236,51 @@ module Twilio
|
|
|
205
236
|
|
|
206
237
|
|
|
207
238
|
|
|
208
|
-
response = @version.
|
|
209
|
-
|
|
239
|
+
response = @version.update_with_metadata('POST', @uri, headers: headers)
|
|
240
|
+
caller_id_instance = CallerIdInstance.new(
|
|
210
241
|
@version,
|
|
211
242
|
response.body,
|
|
212
|
-
|
|
243
|
+
caller_id_sid: @solution[:caller_id_sid],
|
|
213
244
|
)
|
|
214
|
-
|
|
245
|
+
CallerIdInstanceMetadata.new(
|
|
215
246
|
@version,
|
|
216
|
-
|
|
247
|
+
caller_id_instance,
|
|
217
248
|
response.headers,
|
|
218
249
|
response.status_code
|
|
219
250
|
)
|
|
220
251
|
end
|
|
221
252
|
|
|
222
|
-
##
|
|
223
|
-
# Access the messages
|
|
224
|
-
# @return [MessageList]
|
|
225
|
-
# @return [MessageContext]
|
|
226
|
-
def messages
|
|
227
|
-
unless @messages
|
|
228
|
-
@messages = MessageList.new(
|
|
229
|
-
@version, )
|
|
230
|
-
end
|
|
231
|
-
@messages
|
|
232
|
-
end
|
|
233
253
|
|
|
234
254
|
##
|
|
235
255
|
# Provide a user friendly representation
|
|
236
256
|
def to_s
|
|
237
257
|
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
238
|
-
"#<Twilio.
|
|
258
|
+
"#<Twilio.Numbers.V2.CallerIdContext #{context}>"
|
|
239
259
|
end
|
|
240
260
|
|
|
241
261
|
##
|
|
242
262
|
# Provide a detailed, user friendly representation
|
|
243
263
|
def inspect
|
|
244
264
|
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
245
|
-
"#<Twilio.
|
|
265
|
+
"#<Twilio.Numbers.V2.CallerIdContext #{context}>"
|
|
246
266
|
end
|
|
247
267
|
end
|
|
248
268
|
|
|
249
|
-
class
|
|
269
|
+
class CallerIdInstanceMetadata < InstanceResourceMetadata
|
|
250
270
|
##
|
|
251
|
-
# Initializes a new
|
|
271
|
+
# Initializes a new CallerIdInstanceMetadata.
|
|
252
272
|
# @param [Version] version Version that contains the resource
|
|
253
|
-
# @param [}
|
|
273
|
+
# @param [}CallerIdInstance] caller_id_instance The instance associated with the metadata.
|
|
254
274
|
# @param [Hash] headers Header object with response headers.
|
|
255
275
|
# @param [Integer] status_code The HTTP status code of the response.
|
|
256
|
-
# @return [
|
|
257
|
-
def initialize(version,
|
|
276
|
+
# @return [CallerIdInstanceMetadata] The initialized instance with metadata.
|
|
277
|
+
def initialize(version, caller_id_instance, headers, status_code)
|
|
258
278
|
super(version, headers, status_code)
|
|
259
|
-
@
|
|
279
|
+
@caller_id_instance = caller_id_instance
|
|
260
280
|
end
|
|
261
281
|
|
|
262
|
-
def
|
|
263
|
-
@
|
|
282
|
+
def caller_id
|
|
283
|
+
@caller_id_instance
|
|
264
284
|
end
|
|
265
285
|
|
|
266
286
|
def headers
|
|
@@ -272,34 +292,34 @@ module Twilio
|
|
|
272
292
|
end
|
|
273
293
|
|
|
274
294
|
def to_s
|
|
275
|
-
"<Twilio.Api.V2010.
|
|
295
|
+
"<Twilio.Api.V2010.CallerIdInstanceMetadata status=#{@status_code}>"
|
|
276
296
|
end
|
|
277
297
|
end
|
|
278
298
|
|
|
279
|
-
class
|
|
280
|
-
# @param [Array<
|
|
299
|
+
class CallerIdListResponse < InstanceListResource
|
|
300
|
+
# @param [Array<CallerIdInstance>] instance
|
|
281
301
|
# @param [Hash{String => Object}] headers
|
|
282
302
|
# @param [Integer] status_code
|
|
283
303
|
def initialize(version, payload, key)
|
|
284
|
-
@
|
|
285
|
-
|
|
304
|
+
@caller_id_instance = payload.body[key].map do |data|
|
|
305
|
+
CallerIdInstance.new(version, data)
|
|
286
306
|
end
|
|
287
307
|
@headers = payload.headers
|
|
288
308
|
@status_code = payload.status_code
|
|
289
309
|
end
|
|
290
310
|
|
|
291
|
-
def
|
|
311
|
+
def caller_id_instance
|
|
292
312
|
@instance
|
|
293
313
|
end
|
|
294
314
|
end
|
|
295
315
|
|
|
296
|
-
class
|
|
316
|
+
class CallerIdPage < Page
|
|
297
317
|
##
|
|
298
|
-
# Initialize the
|
|
318
|
+
# Initialize the CallerIdPage
|
|
299
319
|
# @param [Version] version Version that contains the resource
|
|
300
320
|
# @param [Response] response Response from the API
|
|
301
321
|
# @param [Hash] solution Path solution for the resource
|
|
302
|
-
# @return [
|
|
322
|
+
# @return [CallerIdPage] CallerIdPage
|
|
303
323
|
def initialize(version, response, solution)
|
|
304
324
|
super(version, response)
|
|
305
325
|
|
|
@@ -309,31 +329,31 @@ module Twilio
|
|
|
309
329
|
end
|
|
310
330
|
|
|
311
331
|
##
|
|
312
|
-
# Build an instance of
|
|
332
|
+
# Build an instance of CallerIdInstance
|
|
313
333
|
# @param [Hash] payload Payload response from the API
|
|
314
|
-
# @return [
|
|
334
|
+
# @return [CallerIdInstance] CallerIdInstance
|
|
315
335
|
def get_instance(payload)
|
|
316
|
-
|
|
336
|
+
CallerIdInstance.new(@version, payload)
|
|
317
337
|
end
|
|
318
338
|
|
|
319
339
|
##
|
|
320
340
|
# Provide a user friendly representation
|
|
321
341
|
def to_s
|
|
322
|
-
'<Twilio.
|
|
342
|
+
'<Twilio.Numbers.V2.CallerIdPage>'
|
|
323
343
|
end
|
|
324
344
|
end
|
|
325
345
|
|
|
326
|
-
class
|
|
327
|
-
attr_reader :
|
|
346
|
+
class CallerIdPageMetadata < PageMetadata
|
|
347
|
+
attr_reader :caller_id_page
|
|
328
348
|
|
|
329
349
|
def initialize(version, response, solution, limit)
|
|
330
350
|
super(version, response)
|
|
331
|
-
@
|
|
351
|
+
@caller_id_page = []
|
|
332
352
|
@limit = limit
|
|
333
353
|
key = get_key(response.body)
|
|
334
354
|
records = 0
|
|
335
355
|
while( limit != :unset && records < limit )
|
|
336
|
-
@
|
|
356
|
+
@caller_id_page << CallerIdListResponse.new(version, @payload, key, limit - records)
|
|
337
357
|
@payload = self.next_page
|
|
338
358
|
break unless @payload
|
|
339
359
|
records += (@payload.body[key] || []).size
|
|
@@ -343,18 +363,18 @@ module Twilio
|
|
|
343
363
|
end
|
|
344
364
|
|
|
345
365
|
def each
|
|
346
|
-
@
|
|
366
|
+
@caller_id_page.each do |record|
|
|
347
367
|
yield record
|
|
348
368
|
end
|
|
349
369
|
end
|
|
350
370
|
|
|
351
371
|
def to_s
|
|
352
|
-
'<Twilio::REST::
|
|
372
|
+
'<Twilio::REST::Numbers::V2PageMetadata>';
|
|
353
373
|
end
|
|
354
374
|
end
|
|
355
|
-
class
|
|
375
|
+
class CallerIdListResponse < InstanceListResource
|
|
356
376
|
|
|
357
|
-
# @param [Array<
|
|
377
|
+
# @param [Array<CallerIdInstance>] instance
|
|
358
378
|
# @param [Hash{String => Object}] headers
|
|
359
379
|
# @param [Integer] status_code
|
|
360
380
|
def initialize(version, payload, key, limit = :unset)
|
|
@@ -362,15 +382,15 @@ module Twilio
|
|
|
362
382
|
if limit != :unset
|
|
363
383
|
data_list = data_list[0, limit]
|
|
364
384
|
end
|
|
365
|
-
@
|
|
366
|
-
|
|
385
|
+
@caller_id = data_list.map do |data|
|
|
386
|
+
CallerIdInstance.new(version, data)
|
|
367
387
|
end
|
|
368
388
|
@headers = payload.headers
|
|
369
389
|
@status_code = payload.status_code
|
|
370
390
|
end
|
|
371
391
|
|
|
372
|
-
def
|
|
373
|
-
@
|
|
392
|
+
def caller_id
|
|
393
|
+
@caller_id
|
|
374
394
|
end
|
|
375
395
|
|
|
376
396
|
def headers
|
|
@@ -382,116 +402,110 @@ module Twilio
|
|
|
382
402
|
end
|
|
383
403
|
end
|
|
384
404
|
|
|
385
|
-
class
|
|
405
|
+
class CallerIdInstance < InstanceResource
|
|
386
406
|
##
|
|
387
|
-
# Initialize the
|
|
407
|
+
# Initialize the CallerIdInstance
|
|
388
408
|
# @param [Version] version Version that contains the resource
|
|
389
409
|
# @param [Hash] payload payload that contains response from Twilio
|
|
390
410
|
# @param [String] account_sid The SID of the
|
|
391
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this
|
|
411
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this CallerId
|
|
392
412
|
# resource.
|
|
393
413
|
# @param [String] sid The SID of the Call resource to fetch.
|
|
394
|
-
# @return [
|
|
395
|
-
def initialize(version, payload ,
|
|
414
|
+
# @return [CallerIdInstance] CallerIdInstance
|
|
415
|
+
def initialize(version, payload , caller_id_sid: nil)
|
|
396
416
|
super(version)
|
|
397
417
|
|
|
398
418
|
|
|
399
419
|
# Marshaled Properties
|
|
400
420
|
@properties = {
|
|
401
|
-
'
|
|
421
|
+
'sid' => payload['sid'],
|
|
402
422
|
'account_sid' => payload['account_sid'],
|
|
403
|
-
'
|
|
404
|
-
'
|
|
405
|
-
'identity' => payload['identity'],
|
|
423
|
+
'phone_number' => payload['phone_number'],
|
|
424
|
+
'friendly_name' => payload['friendly_name'],
|
|
406
425
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
407
426
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
408
427
|
}
|
|
409
428
|
|
|
410
429
|
# Context
|
|
411
430
|
@instance_context = nil
|
|
412
|
-
@params = { '
|
|
431
|
+
@params = { 'caller_id_sid' => caller_id_sid || @properties['caller_id_sid'] , }
|
|
413
432
|
end
|
|
414
433
|
|
|
415
434
|
##
|
|
416
435
|
# Generate an instance context for the instance, the context is capable of
|
|
417
436
|
# performing various actions. All instance actions are proxied to the context
|
|
418
|
-
# @return [
|
|
437
|
+
# @return [CallerIdContext] CallContext for this CallInstance
|
|
419
438
|
def context
|
|
420
439
|
unless @instance_context
|
|
421
|
-
@instance_context =
|
|
440
|
+
@instance_context = CallerIdContext.new(@version , @params['caller_id_sid'])
|
|
422
441
|
end
|
|
423
442
|
@instance_context
|
|
424
443
|
end
|
|
425
444
|
|
|
426
445
|
##
|
|
427
|
-
# @return [String] The
|
|
428
|
-
def
|
|
429
|
-
@properties['
|
|
446
|
+
# @return [String] The unique SID of this Caller ID resource.
|
|
447
|
+
def sid
|
|
448
|
+
@properties['sid']
|
|
430
449
|
end
|
|
431
450
|
|
|
432
451
|
##
|
|
433
|
-
# @return [String] The SID
|
|
452
|
+
# @return [String] The Account SID that owns this Caller ID.
|
|
434
453
|
def account_sid
|
|
435
454
|
@properties['account_sid']
|
|
436
455
|
end
|
|
437
456
|
|
|
438
457
|
##
|
|
439
|
-
# @return [String] The
|
|
440
|
-
def
|
|
441
|
-
@properties['
|
|
442
|
-
end
|
|
443
|
-
|
|
444
|
-
##
|
|
445
|
-
# @return [Boolean] True if the session is verified.
|
|
446
|
-
def verified
|
|
447
|
-
@properties['verified']
|
|
458
|
+
# @return [String] The phone number in E.164 format.
|
|
459
|
+
def phone_number
|
|
460
|
+
@properties['phone_number']
|
|
448
461
|
end
|
|
449
462
|
|
|
450
463
|
##
|
|
451
|
-
# @return [String]
|
|
452
|
-
def
|
|
453
|
-
@properties['
|
|
464
|
+
# @return [String] A human-readable name for this caller ID.
|
|
465
|
+
def friendly_name
|
|
466
|
+
@properties['friendly_name']
|
|
454
467
|
end
|
|
455
468
|
|
|
456
469
|
##
|
|
457
|
-
# @return [Time] The date
|
|
470
|
+
# @return [Time] The date this resource was created.
|
|
458
471
|
def date_created
|
|
459
472
|
@properties['date_created']
|
|
460
473
|
end
|
|
461
474
|
|
|
462
475
|
##
|
|
463
|
-
# @return [Time] The date
|
|
476
|
+
# @return [Time] The date this resource was last updated.
|
|
464
477
|
def date_updated
|
|
465
478
|
@properties['date_updated']
|
|
466
479
|
end
|
|
467
480
|
|
|
468
481
|
##
|
|
469
|
-
#
|
|
470
|
-
# @return [
|
|
471
|
-
def
|
|
482
|
+
# Delete the CallerIdInstance
|
|
483
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
484
|
+
def delete
|
|
472
485
|
|
|
473
|
-
context.
|
|
486
|
+
context.delete
|
|
474
487
|
end
|
|
475
488
|
|
|
476
489
|
##
|
|
477
|
-
#
|
|
478
|
-
# @return [
|
|
479
|
-
def
|
|
480
|
-
|
|
490
|
+
# Update the CallerIdInstance
|
|
491
|
+
# @return [CallerIdInstance] Updated CallerIdInstance
|
|
492
|
+
def update
|
|
493
|
+
|
|
494
|
+
context.update
|
|
481
495
|
end
|
|
482
496
|
|
|
483
497
|
##
|
|
484
498
|
# Provide a user friendly representation
|
|
485
499
|
def to_s
|
|
486
500
|
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
487
|
-
"<Twilio.
|
|
501
|
+
"<Twilio.Numbers.V2.CallerIdInstance #{values}>"
|
|
488
502
|
end
|
|
489
503
|
|
|
490
504
|
##
|
|
491
505
|
# Provide a detailed, user friendly representation
|
|
492
506
|
def inspect
|
|
493
507
|
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
494
|
-
"<Twilio.
|
|
508
|
+
"<Twilio.Numbers.V2.CallerIdInstance #{values}>"
|
|
495
509
|
end
|
|
496
510
|
end
|
|
497
511
|
|
|
@@ -25,6 +25,7 @@ module Twilio
|
|
|
25
25
|
@authorization_documents = nil
|
|
26
26
|
@bulk_hosted_number_orders = nil
|
|
27
27
|
@bundle_clone = nil
|
|
28
|
+
@caller_ids = nil
|
|
28
29
|
@hosted_number_orders = nil
|
|
29
30
|
@regulatory_compliance = nil
|
|
30
31
|
end
|
|
@@ -90,6 +91,21 @@ module Twilio
|
|
|
90
91
|
end
|
|
91
92
|
end
|
|
92
93
|
##
|
|
94
|
+
# @param [String] caller_id_sid
|
|
95
|
+
# @return [Twilio::REST::Numbers::V2::CallerIdContext] if callerIdSid was passed.
|
|
96
|
+
# @return [Twilio::REST::Numbers::V2::CallerIdList]
|
|
97
|
+
def caller_ids(caller_id_sid=:unset)
|
|
98
|
+
if caller_id_sid.nil?
|
|
99
|
+
raise ArgumentError, 'caller_id_sid cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if caller_id_sid == :unset
|
|
103
|
+
@caller_ids ||= CallerIdList.new self
|
|
104
|
+
else
|
|
105
|
+
CallerIdContext.new(self, caller_id_sid)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
##
|
|
93
109
|
# @param [String] sid A 34 character string that uniquely identifies this HostedNumberOrder.
|
|
94
110
|
# @return [Twilio::REST::Numbers::V2::HostedNumberOrderContext] if sid was passed.
|
|
95
111
|
# @return [Twilio::REST::Numbers::V2::HostedNumberOrderList]
|
|
@@ -38,13 +38,17 @@ module Twilio
|
|
|
38
38
|
# @param [String] redirect_uri
|
|
39
39
|
# @param [String] scope
|
|
40
40
|
# @param [String] state
|
|
41
|
+
# @param [String] code_challenge
|
|
42
|
+
# @param [String] code_challenge_method
|
|
41
43
|
# @return [AuthorizeInstance] Fetched AuthorizeInstance
|
|
42
44
|
def fetch(
|
|
43
45
|
response_type: :unset,
|
|
44
46
|
client_id: :unset,
|
|
45
47
|
redirect_uri: :unset,
|
|
46
48
|
scope: :unset,
|
|
47
|
-
state: :unset
|
|
49
|
+
state: :unset,
|
|
50
|
+
code_challenge: :unset,
|
|
51
|
+
code_challenge_method: :unset
|
|
48
52
|
)
|
|
49
53
|
|
|
50
54
|
params = Twilio::Values.of({
|
|
@@ -53,6 +57,8 @@ module Twilio
|
|
|
53
57
|
'redirect_uri' => redirect_uri,
|
|
54
58
|
'scope' => scope,
|
|
55
59
|
'state' => state,
|
|
60
|
+
'code_challenge' => code_challenge,
|
|
61
|
+
'code_challenge_method' => code_challenge_method,
|
|
56
62
|
})
|
|
57
63
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
58
64
|
|
|
@@ -74,13 +80,17 @@ module Twilio
|
|
|
74
80
|
# @param [String] redirect_uri
|
|
75
81
|
# @param [String] scope
|
|
76
82
|
# @param [String] state
|
|
83
|
+
# @param [String] code_challenge
|
|
84
|
+
# @param [String] code_challenge_method
|
|
77
85
|
# @return [AuthorizeInstance] Fetched AuthorizeInstance
|
|
78
86
|
def fetch_with_metadata(
|
|
79
87
|
response_type: :unset,
|
|
80
88
|
client_id: :unset,
|
|
81
89
|
redirect_uri: :unset,
|
|
82
90
|
scope: :unset,
|
|
83
|
-
state: :unset
|
|
91
|
+
state: :unset,
|
|
92
|
+
code_challenge: :unset,
|
|
93
|
+
code_challenge_method: :unset
|
|
84
94
|
)
|
|
85
95
|
|
|
86
96
|
params = Twilio::Values.of({
|
|
@@ -89,6 +99,8 @@ module Twilio
|
|
|
89
99
|
'redirect_uri' => redirect_uri,
|
|
90
100
|
'scope' => scope,
|
|
91
101
|
'state' => state,
|
|
102
|
+
'code_challenge' => code_challenge,
|
|
103
|
+
'code_challenge_method' => code_challenge_method,
|
|
92
104
|
})
|
|
93
105
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
94
106
|
|