twilio-ruby 7.10.7 → 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 +46 -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 +2 -2
- 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 +45 -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 +2 -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 +1 -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 +33 -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
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio API definition for public-api voice
|
|
8
|
+
# Powers Twilio public-api voice
|
|
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 Voice < VoiceBase
|
|
19
|
+
class V2 < Version
|
|
20
|
+
class RecordingList < ListResource
|
|
21
|
+
|
|
22
|
+
class VoiceV2ConfigurationRecordingCompositionPolicy
|
|
23
|
+
# @param [channels]: [String] The number of channels to be composed.
|
|
24
|
+
# @param [trim]: [String] Trim the silence in the recordings.
|
|
25
|
+
# @param [track]: [String] The audio track to record for the call.
|
|
26
|
+
attr_accessor :channels, :trim, :track
|
|
27
|
+
def initialize(payload)
|
|
28
|
+
@channels = payload["channels"]
|
|
29
|
+
@trim = payload["trim"]
|
|
30
|
+
@track = payload["track"]
|
|
31
|
+
end
|
|
32
|
+
def to_json(options = {})
|
|
33
|
+
{
|
|
34
|
+
"channels": @channels,
|
|
35
|
+
"trim": @trim,
|
|
36
|
+
"track": @track,
|
|
37
|
+
}.to_json(options)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class VoiceV2ConfigurationRecordingFeature
|
|
42
|
+
# @param [type]: [String] The type of feature.
|
|
43
|
+
# @param [feature_id]: [String] The ID of the feature.
|
|
44
|
+
# @param [description]: [String] The description of the feature.
|
|
45
|
+
attr_accessor :type, :feature_id, :description
|
|
46
|
+
def initialize(payload)
|
|
47
|
+
@type = payload["type"]
|
|
48
|
+
@feature_id = payload["feature_id"]
|
|
49
|
+
@description = payload["description"]
|
|
50
|
+
end
|
|
51
|
+
def to_json(options = {})
|
|
52
|
+
{
|
|
53
|
+
"type": @type,
|
|
54
|
+
"featureId": @feature_id,
|
|
55
|
+
"description": @description,
|
|
56
|
+
}.to_json(options)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class VoiceV2ConfigurationRecordingRequest
|
|
61
|
+
# @param [unique_name]: [String] The unique name.
|
|
62
|
+
# @param [description]: [String] The description.
|
|
63
|
+
# @param [configuration]: [RecordingList.VoiceV2ConfigurationRecordingConfiguration]
|
|
64
|
+
attr_accessor :unique_name, :description, :configuration
|
|
65
|
+
def initialize(payload)
|
|
66
|
+
@unique_name = payload["unique_name"]
|
|
67
|
+
@description = payload["description"]
|
|
68
|
+
@configuration = payload["configuration"]
|
|
69
|
+
end
|
|
70
|
+
def to_json(options = {})
|
|
71
|
+
{
|
|
72
|
+
"unique_name": @unique_name,
|
|
73
|
+
"description": @description,
|
|
74
|
+
"configuration": @configuration,
|
|
75
|
+
}.to_json(options)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class VoiceV2ConfigurationRecordingStatusCallback
|
|
80
|
+
# @param [url]: [String] The recording status callback URL.
|
|
81
|
+
# @param [method]: [String] The recording status callback method.
|
|
82
|
+
# @param [events]: [Array<String>] The recording status callback events.
|
|
83
|
+
attr_accessor :url, :method, :events
|
|
84
|
+
def initialize(payload)
|
|
85
|
+
@url = payload["url"]
|
|
86
|
+
@method = payload["method"]
|
|
87
|
+
@events = payload["events"]
|
|
88
|
+
end
|
|
89
|
+
def to_json(options = {})
|
|
90
|
+
{
|
|
91
|
+
"url": @url,
|
|
92
|
+
"method": @method,
|
|
93
|
+
"events": @events,
|
|
94
|
+
}.to_json(options)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
##
|
|
100
|
+
# Initialize the RecordingList
|
|
101
|
+
# @param [Version] version Version that contains the resource
|
|
102
|
+
# @return [RecordingList] RecordingList
|
|
103
|
+
def initialize(version)
|
|
104
|
+
super(version)
|
|
105
|
+
|
|
106
|
+
# Path Solution
|
|
107
|
+
@solution = { }
|
|
108
|
+
@uri = "/Configurations/Recording"
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
##
|
|
112
|
+
# Create the RecordingInstance
|
|
113
|
+
# @param [VoiceV2ConfigurationRecordingRequest] voice_v2_configuration_recording_request
|
|
114
|
+
# @return [RecordingInstance] Created RecordingInstance
|
|
115
|
+
def create(voice_v2_configuration_recording_request: :unset
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
119
|
+
headers['Content-Type'] = 'application/json'
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
payload = @version.create('POST', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json)
|
|
125
|
+
RecordingInstance.new(
|
|
126
|
+
@version,
|
|
127
|
+
payload,
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
##
|
|
132
|
+
# Create the RecordingInstanceMetadata
|
|
133
|
+
# @param [VoiceV2ConfigurationRecordingRequest] voice_v2_configuration_recording_request
|
|
134
|
+
# @return [RecordingInstance] Created RecordingInstance
|
|
135
|
+
def create_with_metadata(voice_v2_configuration_recording_request: :unset
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
139
|
+
headers['Content-Type'] = 'application/json'
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json)
|
|
145
|
+
recording_instance = RecordingInstance.new(
|
|
146
|
+
@version,
|
|
147
|
+
response.body,
|
|
148
|
+
)
|
|
149
|
+
RecordingInstanceMetadata.new(
|
|
150
|
+
@version,
|
|
151
|
+
recording_instance,
|
|
152
|
+
response.headers,
|
|
153
|
+
response.status_code
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# Provide a user friendly representation
|
|
161
|
+
def to_s
|
|
162
|
+
'#<Twilio.Voice.V2.RecordingList>'
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class RecordingContext < InstanceContext
|
|
168
|
+
##
|
|
169
|
+
# Initialize the RecordingContext
|
|
170
|
+
# @param [Version] version Version that contains the resource
|
|
171
|
+
# @param [String] id_or_unique_name
|
|
172
|
+
# @return [RecordingContext] RecordingContext
|
|
173
|
+
def initialize(version, id_or_unique_name)
|
|
174
|
+
super(version)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
# Path Solution
|
|
178
|
+
@solution = { id_or_unique_name: id_or_unique_name, }
|
|
179
|
+
@uri = "/Configurations/Recording/#{@solution[:id_or_unique_name]}"
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
end
|
|
183
|
+
##
|
|
184
|
+
# Delete the RecordingInstance
|
|
185
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
186
|
+
def delete
|
|
187
|
+
|
|
188
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@version.delete('DELETE', @uri, headers: headers)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
##
|
|
197
|
+
# Delete the RecordingInstanceMetadata
|
|
198
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
199
|
+
def delete_with_metadata
|
|
200
|
+
|
|
201
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
|
|
206
|
+
recording_instance = RecordingInstance.new(
|
|
207
|
+
@version,
|
|
208
|
+
response.body,
|
|
209
|
+
account_sid: @solution[:account_sid],
|
|
210
|
+
sid: @solution[:sid],
|
|
211
|
+
)
|
|
212
|
+
RecordingInstanceMetadata.new(@version, recording_instance, response.headers, response.status_code)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
##
|
|
216
|
+
# Fetch the RecordingInstance
|
|
217
|
+
# @return [RecordingInstance] Fetched RecordingInstance
|
|
218
|
+
def fetch
|
|
219
|
+
|
|
220
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
payload = @version.fetch('GET', @uri, headers: headers)
|
|
227
|
+
RecordingInstance.new(
|
|
228
|
+
@version,
|
|
229
|
+
payload,
|
|
230
|
+
id_or_unique_name: @solution[:id_or_unique_name],
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
##
|
|
235
|
+
# Fetch the RecordingInstanceMetadata
|
|
236
|
+
# @return [RecordingInstance] Fetched RecordingInstance
|
|
237
|
+
def fetch_with_metadata
|
|
238
|
+
|
|
239
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
response = @version.fetch_with_metadata('GET', @uri, headers: headers)
|
|
246
|
+
recording_instance = RecordingInstance.new(
|
|
247
|
+
@version,
|
|
248
|
+
response.body,
|
|
249
|
+
id_or_unique_name: @solution[:id_or_unique_name],
|
|
250
|
+
)
|
|
251
|
+
RecordingInstanceMetadata.new(
|
|
252
|
+
@version,
|
|
253
|
+
recording_instance,
|
|
254
|
+
response.headers,
|
|
255
|
+
response.status_code
|
|
256
|
+
)
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
##
|
|
260
|
+
# Update the RecordingInstance
|
|
261
|
+
# @param [VoiceV2ConfigurationRecordingRequest] voice_v2_configuration_recording_request
|
|
262
|
+
# @return [RecordingInstance] Updated RecordingInstance
|
|
263
|
+
def update(voice_v2_configuration_recording_request: :unset
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
267
|
+
headers['Content-Type'] = 'application/json'
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
payload = @version.update('PUT', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json)
|
|
273
|
+
RecordingInstance.new(
|
|
274
|
+
@version,
|
|
275
|
+
payload,
|
|
276
|
+
id_or_unique_name: @solution[:id_or_unique_name],
|
|
277
|
+
)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
##
|
|
281
|
+
# Update the RecordingInstanceMetadata
|
|
282
|
+
# @param [VoiceV2ConfigurationRecordingRequest] voice_v2_configuration_recording_request
|
|
283
|
+
# @return [RecordingInstance] Updated RecordingInstance
|
|
284
|
+
def update_with_metadata(voice_v2_configuration_recording_request: :unset
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
288
|
+
headers['Content-Type'] = 'application/json'
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
response = @version.update_with_metadata('PUT', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json)
|
|
294
|
+
recording_instance = RecordingInstance.new(
|
|
295
|
+
@version,
|
|
296
|
+
response.body,
|
|
297
|
+
id_or_unique_name: @solution[:id_or_unique_name],
|
|
298
|
+
)
|
|
299
|
+
RecordingInstanceMetadata.new(
|
|
300
|
+
@version,
|
|
301
|
+
recording_instance,
|
|
302
|
+
response.headers,
|
|
303
|
+
response.status_code
|
|
304
|
+
)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
##
|
|
309
|
+
# Provide a user friendly representation
|
|
310
|
+
def to_s
|
|
311
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
312
|
+
"#<Twilio.Voice.V2.RecordingContext #{context}>"
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
##
|
|
316
|
+
# Provide a detailed, user friendly representation
|
|
317
|
+
def inspect
|
|
318
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
319
|
+
"#<Twilio.Voice.V2.RecordingContext #{context}>"
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
class RecordingInstanceMetadata < InstanceResourceMetadata
|
|
324
|
+
##
|
|
325
|
+
# Initializes a new RecordingInstanceMetadata.
|
|
326
|
+
# @param [Version] version Version that contains the resource
|
|
327
|
+
# @param [}RecordingInstance] recording_instance The instance associated with the metadata.
|
|
328
|
+
# @param [Hash] headers Header object with response headers.
|
|
329
|
+
# @param [Integer] status_code The HTTP status code of the response.
|
|
330
|
+
# @return [RecordingInstanceMetadata] The initialized instance with metadata.
|
|
331
|
+
def initialize(version, recording_instance, headers, status_code)
|
|
332
|
+
super(version, headers, status_code)
|
|
333
|
+
@recording_instance = recording_instance
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
def recording
|
|
337
|
+
@recording_instance
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
def headers
|
|
341
|
+
@headers
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
def status_code
|
|
345
|
+
@status_code
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
def to_s
|
|
349
|
+
"<Twilio.Api.V2010.RecordingInstanceMetadata status=#{@status_code}>"
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
class RecordingListResponse < InstanceListResource
|
|
354
|
+
# @param [Array<RecordingInstance>] instance
|
|
355
|
+
# @param [Hash{String => Object}] headers
|
|
356
|
+
# @param [Integer] status_code
|
|
357
|
+
def initialize(version, payload, key)
|
|
358
|
+
@recording_instance = payload.body[key].map do |data|
|
|
359
|
+
RecordingInstance.new(version, data)
|
|
360
|
+
end
|
|
361
|
+
@headers = payload.headers
|
|
362
|
+
@status_code = payload.status_code
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
def recording_instance
|
|
366
|
+
@instance
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
class RecordingPage < Page
|
|
371
|
+
##
|
|
372
|
+
# Initialize the RecordingPage
|
|
373
|
+
# @param [Version] version Version that contains the resource
|
|
374
|
+
# @param [Response] response Response from the API
|
|
375
|
+
# @param [Hash] solution Path solution for the resource
|
|
376
|
+
# @return [RecordingPage] RecordingPage
|
|
377
|
+
def initialize(version, response, solution)
|
|
378
|
+
super(version, response)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
# Path Solution
|
|
382
|
+
@solution = solution
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
##
|
|
386
|
+
# Build an instance of RecordingInstance
|
|
387
|
+
# @param [Hash] payload Payload response from the API
|
|
388
|
+
# @return [RecordingInstance] RecordingInstance
|
|
389
|
+
def get_instance(payload)
|
|
390
|
+
RecordingInstance.new(@version, payload)
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
##
|
|
394
|
+
# Provide a user friendly representation
|
|
395
|
+
def to_s
|
|
396
|
+
'<Twilio.Voice.V2.RecordingPage>'
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
class RecordingPageMetadata < PageMetadata
|
|
401
|
+
attr_reader :recording_page
|
|
402
|
+
|
|
403
|
+
def initialize(version, response, solution, limit)
|
|
404
|
+
super(version, response)
|
|
405
|
+
@recording_page = []
|
|
406
|
+
@limit = limit
|
|
407
|
+
key = get_key(response.body)
|
|
408
|
+
records = 0
|
|
409
|
+
while( limit != :unset && records < limit )
|
|
410
|
+
@recording_page << RecordingListResponse.new(version, @payload, key, limit - records)
|
|
411
|
+
@payload = self.next_page
|
|
412
|
+
break unless @payload
|
|
413
|
+
records += (@payload.body[key] || []).size
|
|
414
|
+
end
|
|
415
|
+
# Path Solution
|
|
416
|
+
@solution = solution
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
def each
|
|
420
|
+
@recording_page.each do |record|
|
|
421
|
+
yield record
|
|
422
|
+
end
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
def to_s
|
|
426
|
+
'<Twilio::REST::Voice::V2PageMetadata>';
|
|
427
|
+
end
|
|
428
|
+
end
|
|
429
|
+
class RecordingListResponse < InstanceListResource
|
|
430
|
+
|
|
431
|
+
# @param [Array<RecordingInstance>] instance
|
|
432
|
+
# @param [Hash{String => Object}] headers
|
|
433
|
+
# @param [Integer] status_code
|
|
434
|
+
def initialize(version, payload, key, limit = :unset)
|
|
435
|
+
data_list = payload.body[key] || []
|
|
436
|
+
if limit != :unset
|
|
437
|
+
data_list = data_list[0, limit]
|
|
438
|
+
end
|
|
439
|
+
@recording = data_list.map do |data|
|
|
440
|
+
RecordingInstance.new(version, data)
|
|
441
|
+
end
|
|
442
|
+
@headers = payload.headers
|
|
443
|
+
@status_code = payload.status_code
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
def recording
|
|
447
|
+
@recording
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def headers
|
|
451
|
+
@headers
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def status_code
|
|
455
|
+
@status_code
|
|
456
|
+
end
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
class RecordingInstance < InstanceResource
|
|
460
|
+
##
|
|
461
|
+
# Initialize the RecordingInstance
|
|
462
|
+
# @param [Version] version Version that contains the resource
|
|
463
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
464
|
+
# @param [String] account_sid The SID of the
|
|
465
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Recording
|
|
466
|
+
# resource.
|
|
467
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
468
|
+
# @return [RecordingInstance] RecordingInstance
|
|
469
|
+
def initialize(version, payload , id_or_unique_name: nil)
|
|
470
|
+
super(version)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
# Marshaled Properties
|
|
474
|
+
@properties = {
|
|
475
|
+
'id' => payload['id'],
|
|
476
|
+
'account_sid' => payload['account_sid'],
|
|
477
|
+
'unique_name' => payload['unique_name'],
|
|
478
|
+
'description' => payload['description'],
|
|
479
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
480
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
481
|
+
'configuration' => payload['configuration'],
|
|
482
|
+
'message' => payload['message'],
|
|
483
|
+
'code' => payload['code'],
|
|
484
|
+
'status' => payload['status'],
|
|
485
|
+
'more_info' => payload['more_info'],
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
# Context
|
|
489
|
+
@instance_context = nil
|
|
490
|
+
@params = { 'id_or_unique_name' => id_or_unique_name || @properties['id_or_unique_name'] , }
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
##
|
|
494
|
+
# Generate an instance context for the instance, the context is capable of
|
|
495
|
+
# performing various actions. All instance actions are proxied to the context
|
|
496
|
+
# @return [RecordingContext] CallContext for this CallInstance
|
|
497
|
+
def context
|
|
498
|
+
unless @instance_context
|
|
499
|
+
@instance_context = RecordingContext.new(@version , @params['id_or_unique_name'])
|
|
500
|
+
end
|
|
501
|
+
@instance_context
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
##
|
|
505
|
+
# @return [String] Configuration Identifier.
|
|
506
|
+
def id
|
|
507
|
+
@properties['id']
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
##
|
|
511
|
+
# @return [String] Account sid.
|
|
512
|
+
def account_sid
|
|
513
|
+
@properties['account_sid']
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
##
|
|
517
|
+
# @return [String] The unique name.
|
|
518
|
+
def unique_name
|
|
519
|
+
@properties['unique_name']
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
##
|
|
523
|
+
# @return [String] The description.
|
|
524
|
+
def description
|
|
525
|
+
@properties['description']
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
##
|
|
529
|
+
# @return [Time]
|
|
530
|
+
def date_created
|
|
531
|
+
@properties['date_created']
|
|
532
|
+
end
|
|
533
|
+
|
|
534
|
+
##
|
|
535
|
+
# @return [Time]
|
|
536
|
+
def date_updated
|
|
537
|
+
@properties['date_updated']
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
##
|
|
541
|
+
# @return [VoiceV2ConfigurationRecordingConfiguration]
|
|
542
|
+
def configuration
|
|
543
|
+
@properties['configuration']
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
##
|
|
547
|
+
# @return [String] Error message
|
|
548
|
+
def message
|
|
549
|
+
@properties['message']
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
##
|
|
553
|
+
# @return [String] Twilio error code
|
|
554
|
+
def code
|
|
555
|
+
@properties['code']
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
##
|
|
559
|
+
# @return [String] status code
|
|
560
|
+
def status
|
|
561
|
+
@properties['status']
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
##
|
|
565
|
+
# @return [String] More information about the error
|
|
566
|
+
def more_info
|
|
567
|
+
@properties['more_info']
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
##
|
|
571
|
+
# Delete the RecordingInstance
|
|
572
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
573
|
+
def delete
|
|
574
|
+
|
|
575
|
+
context.delete
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
##
|
|
579
|
+
# Fetch the RecordingInstance
|
|
580
|
+
# @return [RecordingInstance] Fetched RecordingInstance
|
|
581
|
+
def fetch
|
|
582
|
+
|
|
583
|
+
context.fetch
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
##
|
|
587
|
+
# Update the RecordingInstance
|
|
588
|
+
# @param [VoiceV2ConfigurationRecordingRequest] voice_v2_configuration_recording_request
|
|
589
|
+
# @return [RecordingInstance] Updated RecordingInstance
|
|
590
|
+
def update(voice_v2_configuration_recording_request: :unset
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
context.update(
|
|
594
|
+
voice_v2_configuration_recording_request: voice_v2_configuration_recording_request,
|
|
595
|
+
)
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
##
|
|
599
|
+
# Provide a user friendly representation
|
|
600
|
+
def to_s
|
|
601
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
602
|
+
"<Twilio.Voice.V2.RecordingInstance #{values}>"
|
|
603
|
+
end
|
|
604
|
+
|
|
605
|
+
##
|
|
606
|
+
# Provide a detailed, user friendly representation
|
|
607
|
+
def inspect
|
|
608
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
609
|
+
"<Twilio.Voice.V2.RecordingInstance #{values}>"
|
|
610
|
+
end
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
end
|
|
614
|
+
end
|
|
615
|
+
end
|
|
616
|
+
end
|