twilio-ruby 5.11.1 → 5.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +18 -0
  3. data/README.md +3 -3
  4. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +24 -0
  5. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +133 -0
  6. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +161 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +349 -0
  8. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +349 -0
  9. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +135 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +349 -0
  11. data/lib/twilio-ruby/rest/preview.rb +8 -8
  12. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  13. data/lib/twilio-ruby/rest/preview/understand/assistant.rb +3 -16
  14. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +42 -2
  15. data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +33 -0
  16. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +27 -19
  17. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb +11 -11
  18. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb +18 -18
  19. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb +17 -15
  20. data/lib/twilio-ruby/rest/video.rb +9 -9
  21. data/lib/twilio-ruby/rest/video/v1.rb +16 -16
  22. data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
  23. data/lib/twilio-ruby/twiml/voice_response.rb +20 -0
  24. data/lib/twilio-ruby/version.rb +1 -1
  25. data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping_spec.rb +220 -0
  26. data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping_spec.rb +220 -0
  27. data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping_spec.rb +12 -0
  28. data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping_spec.rb +220 -0
  29. data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping_spec.rb +12 -0
  30. data/spec/integration/api/v2010/account/sip/domain/auth_types_spec.rb +12 -0
  31. data/spec/integration/preview/understand/assistant_spec.rb +0 -4
  32. data/spec/integration/proxy/v1/service/phone_number_spec.rb +51 -3
  33. data/spec/integration/proxy/v1/service/short_code_spec.rb +50 -3
  34. metadata +21 -3
@@ -0,0 +1,349 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Api < Domain
12
+ class V2010 < Version
13
+ class AccountContext < InstanceContext
14
+ class SipList < ListResource
15
+ class DomainContext < InstanceContext
16
+ class AuthTypesList < ListResource
17
+ class AuthTypeCallsList < ListResource
18
+ class AuthCallsIpAccessControlListMappingList < ListResource
19
+ ##
20
+ # Initialize the AuthCallsIpAccessControlListMappingList
21
+ # @param [Version] version Version that contains the resource
22
+ # @param [String] account_sid The unique id of the
23
+ # [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
24
+ # @param [String] domain_sid A 34 character string that uniquely identifies the
25
+ # SIP domain in Twilio.
26
+ # @return [AuthCallsIpAccessControlListMappingList] AuthCallsIpAccessControlListMappingList
27
+ def initialize(version, account_sid: nil, domain_sid: nil)
28
+ super(version)
29
+
30
+ # Path Solution
31
+ @solution = {account_sid: account_sid, domain_sid: domain_sid}
32
+ @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/Auth/Calls/IpAccessControlListMappings.json"
33
+ end
34
+
35
+ ##
36
+ # Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API.
37
+ # Request is executed immediately.
38
+ # @param [String] ip_access_control_list_sid A 34 character string that uniquely
39
+ # identifies IP Access Control List
40
+ # @return [AuthCallsIpAccessControlListMappingInstance] Newly created AuthCallsIpAccessControlListMappingInstance
41
+ def create(ip_access_control_list_sid: nil)
42
+ data = Twilio::Values.of({'IpAccessControlListSid' => ip_access_control_list_sid, })
43
+
44
+ payload = @version.create(
45
+ 'POST',
46
+ @uri,
47
+ data: data
48
+ )
49
+
50
+ AuthCallsIpAccessControlListMappingInstance.new(
51
+ @version,
52
+ payload,
53
+ account_sid: @solution[:account_sid],
54
+ domain_sid: @solution[:domain_sid],
55
+ )
56
+ end
57
+
58
+ ##
59
+ # Lists AuthCallsIpAccessControlListMappingInstance records from the API as a list.
60
+ # Unlike stream(), this operation is eager and will load `limit` records into
61
+ # memory before returning.
62
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
63
+ # guarantees to never return more than limit. Default is no limit
64
+ # @param [Integer] page_size Number of records to fetch per request, when
65
+ # not set will use the default value of 50 records. If no page_size is defined
66
+ # but a limit is defined, stream() will attempt to read the limit with the most
67
+ # efficient page size, i.e. min(limit, 1000)
68
+ # @return [Array] Array of up to limit results
69
+ def list(limit: nil, page_size: nil)
70
+ self.stream(limit: limit, page_size: page_size).entries
71
+ end
72
+
73
+ ##
74
+ # Streams AuthCallsIpAccessControlListMappingInstance records from the API as an Enumerable.
75
+ # This operation lazily loads records as efficiently as possible until the limit
76
+ # is reached.
77
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
78
+ # guarantees to never return more than limit. Default is no limit.
79
+ # @param [Integer] page_size Number of records to fetch per request, when
80
+ # not set will use the default value of 50 records. If no page_size is defined
81
+ # but a limit is defined, stream() will attempt to read the limit with the most
82
+ # efficient page size, i.e. min(limit, 1000)
83
+ # @return [Enumerable] Enumerable that will yield up to limit results
84
+ def stream(limit: nil, page_size: nil)
85
+ limits = @version.read_limits(limit, page_size)
86
+
87
+ page = self.page(page_size: limits[:page_size], )
88
+
89
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
90
+ end
91
+
92
+ ##
93
+ # When passed a block, yields AuthCallsIpAccessControlListMappingInstance records from the API.
94
+ # This operation lazily loads records as efficiently as possible until the limit
95
+ # is reached.
96
+ def each
97
+ limits = @version.read_limits
98
+
99
+ page = self.page(page_size: limits[:page_size], )
100
+
101
+ @version.stream(page,
102
+ limit: limits[:limit],
103
+ page_limit: limits[:page_limit]).each {|x| yield x}
104
+ end
105
+
106
+ ##
107
+ # Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API.
108
+ # Request is executed immediately.
109
+ # @param [String] page_token PageToken provided by the API
110
+ # @param [Integer] page_number Page Number, this value is simply for client state
111
+ # @param [Integer] page_size Number of records to return, defaults to 50
112
+ # @return [Page] Page of AuthCallsIpAccessControlListMappingInstance
113
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
114
+ params = Twilio::Values.of({
115
+ 'PageToken' => page_token,
116
+ 'Page' => page_number,
117
+ 'PageSize' => page_size,
118
+ })
119
+ response = @version.page(
120
+ 'GET',
121
+ @uri,
122
+ params
123
+ )
124
+ AuthCallsIpAccessControlListMappingPage.new(@version, response, @solution)
125
+ end
126
+
127
+ ##
128
+ # Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API.
129
+ # Request is executed immediately.
130
+ # @param [String] target_url API-generated URL for the requested results page
131
+ # @return [Page] Page of AuthCallsIpAccessControlListMappingInstance
132
+ def get_page(target_url)
133
+ response = @version.domain.request(
134
+ 'GET',
135
+ target_url
136
+ )
137
+ AuthCallsIpAccessControlListMappingPage.new(@version, response, @solution)
138
+ end
139
+
140
+ ##
141
+ # Provide a user friendly representation
142
+ def to_s
143
+ '#<Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList>'
144
+ end
145
+ end
146
+
147
+ class AuthCallsIpAccessControlListMappingPage < Page
148
+ ##
149
+ # Initialize the AuthCallsIpAccessControlListMappingPage
150
+ # @param [Version] version Version that contains the resource
151
+ # @param [Response] response Response from the API
152
+ # @param [Hash] solution Path solution for the resource
153
+ # @return [AuthCallsIpAccessControlListMappingPage] AuthCallsIpAccessControlListMappingPage
154
+ def initialize(version, response, solution)
155
+ super(version, response)
156
+
157
+ # Path Solution
158
+ @solution = solution
159
+ end
160
+
161
+ ##
162
+ # Build an instance of AuthCallsIpAccessControlListMappingInstance
163
+ # @param [Hash] payload Payload response from the API
164
+ # @return [AuthCallsIpAccessControlListMappingInstance] AuthCallsIpAccessControlListMappingInstance
165
+ def get_instance(payload)
166
+ AuthCallsIpAccessControlListMappingInstance.new(
167
+ @version,
168
+ payload,
169
+ account_sid: @solution[:account_sid],
170
+ domain_sid: @solution[:domain_sid],
171
+ )
172
+ end
173
+
174
+ ##
175
+ # Provide a user friendly representation
176
+ def to_s
177
+ '<Twilio.Api.V2010.AuthCallsIpAccessControlListMappingPage>'
178
+ end
179
+ end
180
+
181
+ class AuthCallsIpAccessControlListMappingContext < InstanceContext
182
+ ##
183
+ # Initialize the AuthCallsIpAccessControlListMappingContext
184
+ # @param [Version] version Version that contains the resource
185
+ # @param [String] account_sid The account_sid
186
+ # @param [String] domain_sid The domain_sid
187
+ # @param [String] sid The IP Access Control List Sid that uniquely identifies this
188
+ # resource
189
+ # @return [AuthCallsIpAccessControlListMappingContext] AuthCallsIpAccessControlListMappingContext
190
+ def initialize(version, account_sid, domain_sid, sid)
191
+ super(version)
192
+
193
+ # Path Solution
194
+ @solution = {account_sid: account_sid, domain_sid: domain_sid, sid: sid, }
195
+ @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/Auth/Calls/IpAccessControlListMappings/#{@solution[:sid]}.json"
196
+ end
197
+
198
+ ##
199
+ # Fetch a AuthCallsIpAccessControlListMappingInstance
200
+ # @return [AuthCallsIpAccessControlListMappingInstance] Fetched AuthCallsIpAccessControlListMappingInstance
201
+ def fetch
202
+ params = Twilio::Values.of({})
203
+
204
+ payload = @version.fetch(
205
+ 'GET',
206
+ @uri,
207
+ params,
208
+ )
209
+
210
+ AuthCallsIpAccessControlListMappingInstance.new(
211
+ @version,
212
+ payload,
213
+ account_sid: @solution[:account_sid],
214
+ domain_sid: @solution[:domain_sid],
215
+ sid: @solution[:sid],
216
+ )
217
+ end
218
+
219
+ ##
220
+ # Deletes the AuthCallsIpAccessControlListMappingInstance
221
+ # @return [Boolean] true if delete succeeds, true otherwise
222
+ def delete
223
+ @version.delete('delete', @uri)
224
+ end
225
+
226
+ ##
227
+ # Provide a user friendly representation
228
+ def to_s
229
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
230
+ "#<Twilio.Api.V2010.AuthCallsIpAccessControlListMappingContext #{context}>"
231
+ end
232
+ end
233
+
234
+ class AuthCallsIpAccessControlListMappingInstance < InstanceResource
235
+ ##
236
+ # Initialize the AuthCallsIpAccessControlListMappingInstance
237
+ # @param [Version] version Version that contains the resource
238
+ # @param [Hash] payload payload that contains response from Twilio
239
+ # @param [String] account_sid The unique id of the
240
+ # [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
241
+ # @param [String] domain_sid A 34 character string that uniquely identifies the
242
+ # SIP domain in Twilio.
243
+ # @param [String] sid The IP Access Control List Sid that uniquely identifies this
244
+ # resource
245
+ # @return [AuthCallsIpAccessControlListMappingInstance] AuthCallsIpAccessControlListMappingInstance
246
+ def initialize(version, payload, account_sid: nil, domain_sid: nil, sid: nil)
247
+ super(version)
248
+
249
+ # Marshaled Properties
250
+ @properties = {
251
+ 'account_sid' => payload['account_sid'],
252
+ 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
253
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
254
+ 'friendly_name' => payload['friendly_name'],
255
+ 'sid' => payload['sid'],
256
+ }
257
+
258
+ # Context
259
+ @instance_context = nil
260
+ @params = {
261
+ 'account_sid' => account_sid,
262
+ 'domain_sid' => domain_sid,
263
+ 'sid' => sid || @properties['sid'],
264
+ }
265
+ end
266
+
267
+ ##
268
+ # Generate an instance context for the instance, the context is capable of
269
+ # performing various actions. All instance actions are proxied to the context
270
+ # @return [AuthCallsIpAccessControlListMappingContext] AuthCallsIpAccessControlListMappingContext for this AuthCallsIpAccessControlListMappingInstance
271
+ def context
272
+ unless @instance_context
273
+ @instance_context = AuthCallsIpAccessControlListMappingContext.new(
274
+ @version,
275
+ @params['account_sid'],
276
+ @params['domain_sid'],
277
+ @params['sid'],
278
+ )
279
+ end
280
+ @instance_context
281
+ end
282
+
283
+ ##
284
+ # @return [String] The unique sid that identifies this account
285
+ def account_sid
286
+ @properties['account_sid']
287
+ end
288
+
289
+ ##
290
+ # @return [Time] The date this resource was created
291
+ def date_created
292
+ @properties['date_created']
293
+ end
294
+
295
+ ##
296
+ # @return [Time] The date this resource was last updated
297
+ def date_updated
298
+ @properties['date_updated']
299
+ end
300
+
301
+ ##
302
+ # @return [String] A human readable description of this resource
303
+ def friendly_name
304
+ @properties['friendly_name']
305
+ end
306
+
307
+ ##
308
+ # @return [String] A string that uniquely identifies this resource
309
+ def sid
310
+ @properties['sid']
311
+ end
312
+
313
+ ##
314
+ # Fetch a AuthCallsIpAccessControlListMappingInstance
315
+ # @return [AuthCallsIpAccessControlListMappingInstance] Fetched AuthCallsIpAccessControlListMappingInstance
316
+ def fetch
317
+ context.fetch
318
+ end
319
+
320
+ ##
321
+ # Deletes the AuthCallsIpAccessControlListMappingInstance
322
+ # @return [Boolean] true if delete succeeds, true otherwise
323
+ def delete
324
+ context.delete
325
+ end
326
+
327
+ ##
328
+ # Provide a user friendly representation
329
+ def to_s
330
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
331
+ "<Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance #{values}>"
332
+ end
333
+
334
+ ##
335
+ # Provide a detailed, user friendly representation
336
+ def inspect
337
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
338
+ "<Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance #{values}>"
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
348
+ end
349
+ end
@@ -0,0 +1,135 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Api < Domain
12
+ class V2010 < Version
13
+ class AccountContext < InstanceContext
14
+ class SipList < ListResource
15
+ class DomainContext < InstanceContext
16
+ class AuthTypesList < ListResource
17
+ class AuthTypeRegistrationsList < ListResource
18
+ ##
19
+ # Initialize the AuthTypeRegistrationsList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] account_sid The unique id of the
22
+ # [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
23
+ # @param [String] domain_sid A 34 character string that uniquely identifies the
24
+ # SIP domain in Twilio.
25
+ # @return [AuthTypeRegistrationsList] AuthTypeRegistrationsList
26
+ def initialize(version, account_sid: nil, domain_sid: nil)
27
+ super(version)
28
+
29
+ # Path Solution
30
+ @solution = {account_sid: account_sid, domain_sid: domain_sid}
31
+
32
+ # Components
33
+ @credential_list_mappings = nil
34
+ end
35
+
36
+ ##
37
+ # Access the credential_list_mappings
38
+ # @param [String] sid The credential list Sid that uniquely identifies this
39
+ # resource
40
+ # @return [AuthRegistrationsCredentialListMappingList]
41
+ # @return [AuthRegistrationsCredentialListMappingContext] if sid was passed.
42
+ def credential_list_mappings(sid=:unset)
43
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
44
+
45
+ if sid != :unset
46
+ return AuthRegistrationsCredentialListMappingContext.new(
47
+ @version,
48
+ @solution[:account_sid],
49
+ @solution[:domain_sid],
50
+ sid,
51
+ )
52
+ end
53
+
54
+ @credential_list_mappings ||= AuthRegistrationsCredentialListMappingList.new(
55
+ @version,
56
+ account_sid: @solution[:account_sid],
57
+ domain_sid: @solution[:domain_sid],
58
+ )
59
+ end
60
+
61
+ ##
62
+ # Provide a user friendly representation
63
+ def to_s
64
+ '#<Twilio.Api.V2010.AuthTypeRegistrationsList>'
65
+ end
66
+ end
67
+
68
+ class AuthTypeRegistrationsPage < Page
69
+ ##
70
+ # Initialize the AuthTypeRegistrationsPage
71
+ # @param [Version] version Version that contains the resource
72
+ # @param [Response] response Response from the API
73
+ # @param [Hash] solution Path solution for the resource
74
+ # @return [AuthTypeRegistrationsPage] AuthTypeRegistrationsPage
75
+ def initialize(version, response, solution)
76
+ super(version, response)
77
+
78
+ # Path Solution
79
+ @solution = solution
80
+ end
81
+
82
+ ##
83
+ # Build an instance of AuthTypeRegistrationsInstance
84
+ # @param [Hash] payload Payload response from the API
85
+ # @return [AuthTypeRegistrationsInstance] AuthTypeRegistrationsInstance
86
+ def get_instance(payload)
87
+ AuthTypeRegistrationsInstance.new(
88
+ @version,
89
+ payload,
90
+ account_sid: @solution[:account_sid],
91
+ domain_sid: @solution[:domain_sid],
92
+ )
93
+ end
94
+
95
+ ##
96
+ # Provide a user friendly representation
97
+ def to_s
98
+ '<Twilio.Api.V2010.AuthTypeRegistrationsPage>'
99
+ end
100
+ end
101
+
102
+ class AuthTypeRegistrationsInstance < InstanceResource
103
+ ##
104
+ # Initialize the AuthTypeRegistrationsInstance
105
+ # @param [Version] version Version that contains the resource
106
+ # @param [Hash] payload payload that contains response from Twilio
107
+ # @param [String] account_sid The unique id of the
108
+ # [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
109
+ # @param [String] domain_sid A 34 character string that uniquely identifies the
110
+ # SIP domain in Twilio.
111
+ # @return [AuthTypeRegistrationsInstance] AuthTypeRegistrationsInstance
112
+ def initialize(version, payload, account_sid: nil, domain_sid: nil)
113
+ super(version)
114
+ end
115
+
116
+ ##
117
+ # Provide a user friendly representation
118
+ def to_s
119
+ "<Twilio.Api.V2010.AuthTypeRegistrationsInstance>"
120
+ end
121
+
122
+ ##
123
+ # Provide a detailed, user friendly representation
124
+ def inspect
125
+ "<Twilio.Api.V2010.AuthTypeRegistrationsInstance>"
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end