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