twilio-ruby 5.70.0 → 5.70.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/Makefile +1 -1
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +4 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +3 -3
  7. data/lib/twilio-ruby/rest/client.rb +14 -0
  8. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +4 -5
  9. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +305 -0
  10. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +332 -0
  11. data/lib/twilio-ruby/rest/microvisor/v1.rb +60 -0
  12. data/lib/twilio-ruby/rest/microvisor.rb +54 -0
  13. data/lib/twilio-ruby/rest/preview.rb +0 -25
  14. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +261 -0
  15. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +253 -0
  16. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +261 -0
  17. data/lib/twilio-ruby/rest/routes/v2.rb +76 -0
  18. data/lib/twilio-ruby/rest/routes.rb +62 -0
  19. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +16 -6
  20. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  21. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  22. data/lib/twilio-ruby/version.rb +1 -1
  23. metadata +11 -8
  24. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -294
  25. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +0 -275
  26. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +0 -249
  27. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -251
  28. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -234
  29. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -62
@@ -0,0 +1,332 @@
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 Microvisor < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ class DeviceList < ListResource
16
+ ##
17
+ # Initialize the DeviceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DeviceList] DeviceList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Devices"
26
+ end
27
+
28
+ ##
29
+ # Lists DeviceInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
33
+ # guarantees to never return more than limit. Default is no limit
34
+ # @param [Integer] page_size Number of records to fetch per request, when
35
+ # not set will use the default value of 50 records. If no page_size is defined
36
+ # but a limit is defined, stream() will attempt to read the limit with the most
37
+ # efficient page size, i.e. min(limit, 1000)
38
+ # @return [Array] Array of up to limit results
39
+ def list(limit: nil, page_size: nil)
40
+ self.stream(limit: limit, page_size: page_size).entries
41
+ end
42
+
43
+ ##
44
+ # Streams DeviceInstance records from the API as an Enumerable.
45
+ # This operation lazily loads records as efficiently as possible until the limit
46
+ # is reached.
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
+ # @return [Enumerable] Enumerable that will yield up to limit results
54
+ def stream(limit: nil, page_size: nil)
55
+ limits = @version.read_limits(limit, page_size)
56
+
57
+ page = self.page(page_size: limits[:page_size], )
58
+
59
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
60
+ end
61
+
62
+ ##
63
+ # When passed a block, yields DeviceInstance records from the API.
64
+ # This operation lazily loads records as efficiently as possible until the limit
65
+ # is reached.
66
+ def each
67
+ limits = @version.read_limits
68
+
69
+ page = self.page(page_size: limits[:page_size], )
70
+
71
+ @version.stream(page,
72
+ limit: limits[:limit],
73
+ page_limit: limits[:page_limit]).each {|x| yield x}
74
+ end
75
+
76
+ ##
77
+ # Retrieve a single page of DeviceInstance records from the API.
78
+ # Request is executed immediately.
79
+ # @param [String] page_token PageToken provided by the API
80
+ # @param [Integer] page_number Page Number, this value is simply for client state
81
+ # @param [Integer] page_size Number of records to return, defaults to 50
82
+ # @return [Page] Page of DeviceInstance
83
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
84
+ params = Twilio::Values.of({
85
+ 'PageToken' => page_token,
86
+ 'Page' => page_number,
87
+ 'PageSize' => page_size,
88
+ })
89
+
90
+ response = @version.page('GET', @uri, params: params)
91
+
92
+ DevicePage.new(@version, response, @solution)
93
+ end
94
+
95
+ ##
96
+ # Retrieve a single page of DeviceInstance records from the API.
97
+ # Request is executed immediately.
98
+ # @param [String] target_url API-generated URL for the requested results page
99
+ # @return [Page] Page of DeviceInstance
100
+ def get_page(target_url)
101
+ response = @version.domain.request(
102
+ 'GET',
103
+ target_url
104
+ )
105
+ DevicePage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '#<Twilio.Microvisor.V1.DeviceList>'
112
+ end
113
+ end
114
+
115
+ ##
116
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
117
+ class DevicePage < Page
118
+ ##
119
+ # Initialize the DevicePage
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Response] response Response from the API
122
+ # @param [Hash] solution Path solution for the resource
123
+ # @return [DevicePage] DevicePage
124
+ def initialize(version, response, solution)
125
+ super(version, response)
126
+
127
+ # Path Solution
128
+ @solution = solution
129
+ end
130
+
131
+ ##
132
+ # Build an instance of DeviceInstance
133
+ # @param [Hash] payload Payload response from the API
134
+ # @return [DeviceInstance] DeviceInstance
135
+ def get_instance(payload)
136
+ DeviceInstance.new(@version, payload, )
137
+ end
138
+
139
+ ##
140
+ # Provide a user friendly representation
141
+ def to_s
142
+ '<Twilio.Microvisor.V1.DevicePage>'
143
+ end
144
+ end
145
+
146
+ ##
147
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
148
+ class DeviceContext < InstanceContext
149
+ ##
150
+ # Initialize the DeviceContext
151
+ # @param [Version] version Version that contains the resource
152
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
153
+ # @return [DeviceContext] DeviceContext
154
+ def initialize(version, sid)
155
+ super(version)
156
+
157
+ # Path Solution
158
+ @solution = {sid: sid, }
159
+ @uri = "/Devices/#{@solution[:sid]}"
160
+ end
161
+
162
+ ##
163
+ # Fetch the DeviceInstance
164
+ # @return [DeviceInstance] Fetched DeviceInstance
165
+ def fetch
166
+ payload = @version.fetch('GET', @uri)
167
+
168
+ DeviceInstance.new(@version, payload, sid: @solution[:sid], )
169
+ end
170
+
171
+ ##
172
+ # Update the DeviceInstance
173
+ # @param [String] unique_name A unique and addressable name to be assigned to this
174
+ # Device by the developer. It may be used in place of the Device SID.
175
+ # @param [String] target_app The SID or unique name of the App to be targeted to
176
+ # the Device.
177
+ # @param [Boolean] logging_enabled A Boolean flag specifying whether to enable
178
+ # application logging. Logs will be enabled or extended for 24 hours.
179
+ # @return [DeviceInstance] Updated DeviceInstance
180
+ def update(unique_name: :unset, target_app: :unset, logging_enabled: :unset)
181
+ data = Twilio::Values.of({
182
+ 'UniqueName' => unique_name,
183
+ 'TargetApp' => target_app,
184
+ 'LoggingEnabled' => logging_enabled,
185
+ })
186
+
187
+ payload = @version.update('POST', @uri, data: data)
188
+
189
+ DeviceInstance.new(@version, payload, sid: @solution[:sid], )
190
+ end
191
+
192
+ ##
193
+ # Provide a user friendly representation
194
+ def to_s
195
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
196
+ "#<Twilio.Microvisor.V1.DeviceContext #{context}>"
197
+ end
198
+
199
+ ##
200
+ # Provide a detailed, user friendly representation
201
+ def inspect
202
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
203
+ "#<Twilio.Microvisor.V1.DeviceContext #{context}>"
204
+ end
205
+ end
206
+
207
+ ##
208
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
209
+ class DeviceInstance < InstanceResource
210
+ ##
211
+ # Initialize the DeviceInstance
212
+ # @param [Version] version Version that contains the resource
213
+ # @param [Hash] payload payload that contains response from Twilio
214
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
215
+ # @return [DeviceInstance] DeviceInstance
216
+ def initialize(version, payload, sid: nil)
217
+ super(version)
218
+
219
+ # Marshaled Properties
220
+ @properties = {
221
+ 'sid' => payload['sid'],
222
+ 'unique_name' => payload['unique_name'],
223
+ 'account_sid' => payload['account_sid'],
224
+ 'app' => payload['app'],
225
+ 'logging' => payload['logging'],
226
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
227
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
228
+ 'url' => payload['url'],
229
+ }
230
+
231
+ # Context
232
+ @instance_context = nil
233
+ @params = {'sid' => sid || @properties['sid'], }
234
+ end
235
+
236
+ ##
237
+ # Generate an instance context for the instance, the context is capable of
238
+ # performing various actions. All instance actions are proxied to the context
239
+ # @return [DeviceContext] DeviceContext for this DeviceInstance
240
+ def context
241
+ unless @instance_context
242
+ @instance_context = DeviceContext.new(@version, @params['sid'], )
243
+ end
244
+ @instance_context
245
+ end
246
+
247
+ ##
248
+ # @return [String] A string that uniquely identifies this Device.
249
+ def sid
250
+ @properties['sid']
251
+ end
252
+
253
+ ##
254
+ # @return [String] A developer-defined string that uniquely identifies the Device.
255
+ def unique_name
256
+ @properties['unique_name']
257
+ end
258
+
259
+ ##
260
+ # @return [String] Account SID.
261
+ def account_sid
262
+ @properties['account_sid']
263
+ end
264
+
265
+ ##
266
+ # @return [Hash] Information about the target App and the App reported by this Device.
267
+ def app
268
+ @properties['app']
269
+ end
270
+
271
+ ##
272
+ # @return [Hash] Object specifying whether application logging is enabled for this Device.
273
+ def logging
274
+ @properties['logging']
275
+ end
276
+
277
+ ##
278
+ # @return [Time] The date that this Device was created.
279
+ def date_created
280
+ @properties['date_created']
281
+ end
282
+
283
+ ##
284
+ # @return [Time] The date that this Device was last updated.
285
+ def date_updated
286
+ @properties['date_updated']
287
+ end
288
+
289
+ ##
290
+ # @return [String] The URL of this resource.
291
+ def url
292
+ @properties['url']
293
+ end
294
+
295
+ ##
296
+ # Fetch the DeviceInstance
297
+ # @return [DeviceInstance] Fetched DeviceInstance
298
+ def fetch
299
+ context.fetch
300
+ end
301
+
302
+ ##
303
+ # Update the DeviceInstance
304
+ # @param [String] unique_name A unique and addressable name to be assigned to this
305
+ # Device by the developer. It may be used in place of the Device SID.
306
+ # @param [String] target_app The SID or unique name of the App to be targeted to
307
+ # the Device.
308
+ # @param [Boolean] logging_enabled A Boolean flag specifying whether to enable
309
+ # application logging. Logs will be enabled or extended for 24 hours.
310
+ # @return [DeviceInstance] Updated DeviceInstance
311
+ def update(unique_name: :unset, target_app: :unset, logging_enabled: :unset)
312
+ context.update(unique_name: unique_name, target_app: target_app, logging_enabled: logging_enabled, )
313
+ end
314
+
315
+ ##
316
+ # Provide a user friendly representation
317
+ def to_s
318
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
319
+ "<Twilio.Microvisor.V1.DeviceInstance #{values}>"
320
+ end
321
+
322
+ ##
323
+ # Provide a detailed, user friendly representation
324
+ def inspect
325
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
326
+ "<Twilio.Microvisor.V1.DeviceInstance #{values}>"
327
+ end
328
+ end
329
+ end
330
+ end
331
+ end
332
+ end
@@ -0,0 +1,60 @@
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 Microvisor
12
+ class V1 < Version
13
+ ##
14
+ # Initialize the V1 version of Microvisor
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v1'
18
+ @apps = nil
19
+ @devices = nil
20
+ end
21
+
22
+ ##
23
+ # @param [String] sid A 34-character string that uniquely identifies this App.
24
+ # @return [Twilio::REST::Microvisor::V1::AppContext] if sid was passed.
25
+ # @return [Twilio::REST::Microvisor::V1::AppList]
26
+ def apps(sid=:unset)
27
+ if sid.nil?
28
+ raise ArgumentError, 'sid cannot be nil'
29
+ end
30
+ if sid == :unset
31
+ @apps ||= AppList.new self
32
+ else
33
+ AppContext.new(self, sid)
34
+ end
35
+ end
36
+
37
+ ##
38
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
39
+ # @return [Twilio::REST::Microvisor::V1::DeviceContext] if sid was passed.
40
+ # @return [Twilio::REST::Microvisor::V1::DeviceList]
41
+ def devices(sid=:unset)
42
+ if sid.nil?
43
+ raise ArgumentError, 'sid cannot be nil'
44
+ end
45
+ if sid == :unset
46
+ @devices ||= DeviceList.new self
47
+ else
48
+ DeviceContext.new(self, sid)
49
+ end
50
+ end
51
+
52
+ ##
53
+ # Provide a user friendly representation
54
+ def to_s
55
+ '<Twilio::REST::Microvisor::V1>'
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,54 @@
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 Microvisor < Domain
12
+ ##
13
+ # Initialize the Microvisor Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://microvisor.twilio.com'
18
+ @host = 'microvisor.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v1 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v1 of microvisor
27
+ def v1
28
+ @v1 ||= V1.new self
29
+ end
30
+
31
+ ##
32
+ # @param [String] sid A 34-character string that uniquely identifies this App.
33
+ # @return [Twilio::REST::Microvisor::V1::AppInstance] if sid was passed.
34
+ # @return [Twilio::REST::Microvisor::V1::AppList]
35
+ def apps(sid=:unset)
36
+ self.v1.apps(sid)
37
+ end
38
+
39
+ ##
40
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
41
+ # @return [Twilio::REST::Microvisor::V1::DeviceInstance] if sid was passed.
42
+ # @return [Twilio::REST::Microvisor::V1::DeviceList]
43
+ def devices(sid=:unset)
44
+ self.v1.devices(sid)
45
+ end
46
+
47
+ ##
48
+ # Provide a user friendly representation
49
+ def to_s
50
+ '#<Twilio::REST::Microvisor>'
51
+ end
52
+ end
53
+ end
54
+ end
@@ -19,7 +19,6 @@ module Twilio
19
19
  @port = 443
20
20
 
21
21
  # Versions
22
- @bulk_exports = nil
23
22
  @deployed_devices = nil
24
23
  @hosted_numbers = nil
25
24
  @marketplace = nil
@@ -29,12 +28,6 @@ module Twilio
29
28
  @trusted_comms = nil
30
29
  end
31
30
 
32
- ##
33
- # Version bulk_exports of preview
34
- def bulk_exports
35
- @bulk_exports ||= BulkExports.new self
36
- end
37
-
38
31
  ##
39
32
  # Version deployed_devices of preview
40
33
  def deployed_devices
@@ -77,24 +70,6 @@ module Twilio
77
70
  @trusted_comms ||= TrustedComms.new self
78
71
  end
79
72
 
80
- ##
81
- # @param [String] resource_type The type of communication – Messages, Calls,
82
- # Conferences, and Participants
83
- # @return [Twilio::REST::Preview::BulkExports::ExportInstance] if resource_type was passed.
84
- # @return [Twilio::REST::Preview::BulkExports::ExportList]
85
- def exports(resource_type=:unset)
86
- self.bulk_exports.exports(resource_type)
87
- end
88
-
89
- ##
90
- # @param [String] resource_type The type of communication – Messages, Calls,
91
- # Conferences, and Participants
92
- # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationInstance] if resource_type was passed.
93
- # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationList]
94
- def export_configuration(resource_type=:unset)
95
- self.bulk_exports.export_configuration(resource_type)
96
- end
97
-
98
73
  ##
99
74
  # @param [String] sid Contains a 34 character string that uniquely identifies this
100
75
  # Fleet resource.