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,261 @@
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 Routes < Domain
12
+ class V2 < Version
13
+ class PhoneNumberList < ListResource
14
+ ##
15
+ # Initialize the PhoneNumberList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [PhoneNumberList] PhoneNumberList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Routes.V2.PhoneNumberList>'
29
+ end
30
+ end
31
+
32
+ class PhoneNumberPage < Page
33
+ ##
34
+ # Initialize the PhoneNumberPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [PhoneNumberPage] PhoneNumberPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of PhoneNumberInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [PhoneNumberInstance] PhoneNumberInstance
50
+ def get_instance(payload)
51
+ PhoneNumberInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Routes.V2.PhoneNumberPage>'
58
+ end
59
+ end
60
+
61
+ class PhoneNumberContext < InstanceContext
62
+ ##
63
+ # Initialize the PhoneNumberContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] phone_number The phone number in E.164 format
66
+ # @return [PhoneNumberContext] PhoneNumberContext
67
+ def initialize(version, phone_number)
68
+ super(version)
69
+
70
+ # Path Solution
71
+ @solution = {phone_number: phone_number, }
72
+ @uri = "/PhoneNumbers/#{@solution[:phone_number]}"
73
+ end
74
+
75
+ ##
76
+ # Create the PhoneNumberInstance
77
+ # @param [String] voice_region The Inbound Processing Region used for this phone
78
+ # number for voice
79
+ # @param [String] friendly_name A human readable description of this resource, up
80
+ # to 64 characters.
81
+ # @return [PhoneNumberInstance] Created PhoneNumberInstance
82
+ def create(voice_region: :unset, friendly_name: :unset)
83
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
84
+
85
+ payload = @version.create('POST', @uri, data: data)
86
+
87
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
88
+ end
89
+
90
+ ##
91
+ # Update the PhoneNumberInstance
92
+ # @param [String] voice_region The Inbound Processing Region used for this phone
93
+ # number for voice
94
+ # @param [String] friendly_name A human readable description of this resource, up
95
+ # to 64 characters.
96
+ # @return [PhoneNumberInstance] Updated PhoneNumberInstance
97
+ def update(voice_region: nil, friendly_name: nil)
98
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
99
+
100
+ payload = @version.update('POST', @uri, data: data)
101
+
102
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
103
+ end
104
+
105
+ ##
106
+ # Fetch the PhoneNumberInstance
107
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
108
+ def fetch
109
+ payload = @version.fetch('GET', @uri)
110
+
111
+ PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
112
+ end
113
+
114
+ ##
115
+ # Provide a user friendly representation
116
+ def to_s
117
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
118
+ "#<Twilio.Routes.V2.PhoneNumberContext #{context}>"
119
+ end
120
+
121
+ ##
122
+ # Provide a detailed, user friendly representation
123
+ def inspect
124
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
125
+ "#<Twilio.Routes.V2.PhoneNumberContext #{context}>"
126
+ end
127
+ end
128
+
129
+ class PhoneNumberInstance < InstanceResource
130
+ ##
131
+ # Initialize the PhoneNumberInstance
132
+ # @param [Version] version Version that contains the resource
133
+ # @param [Hash] payload payload that contains response from Twilio
134
+ # @param [String] phone_number The phone number in E.164 format
135
+ # @return [PhoneNumberInstance] PhoneNumberInstance
136
+ def initialize(version, payload, phone_number: nil)
137
+ super(version)
138
+
139
+ # Marshaled Properties
140
+ @properties = {
141
+ 'phone_number' => payload['phone_number'],
142
+ 'url' => payload['url'],
143
+ 'sid' => payload['sid'],
144
+ 'account_sid' => payload['account_sid'],
145
+ 'friendly_name' => payload['friendly_name'],
146
+ 'voice_region' => payload['voice_region'],
147
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
148
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
149
+ }
150
+
151
+ # Context
152
+ @instance_context = nil
153
+ @params = {'phone_number' => phone_number || @properties['phone_number'], }
154
+ end
155
+
156
+ ##
157
+ # Generate an instance context for the instance, the context is capable of
158
+ # performing various actions. All instance actions are proxied to the context
159
+ # @return [PhoneNumberContext] PhoneNumberContext for this PhoneNumberInstance
160
+ def context
161
+ unless @instance_context
162
+ @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], )
163
+ end
164
+ @instance_context
165
+ end
166
+
167
+ ##
168
+ # @return [String] The phone number
169
+ def phone_number
170
+ @properties['phone_number']
171
+ end
172
+
173
+ ##
174
+ # @return [String] The absolute URL of the resource
175
+ def url
176
+ @properties['url']
177
+ end
178
+
179
+ ##
180
+ # @return [String] A string that uniquely identifies the Inbound Processing Region assignments for this phone number.
181
+ def sid
182
+ @properties['sid']
183
+ end
184
+
185
+ ##
186
+ # @return [String] Account Sid.
187
+ def account_sid
188
+ @properties['account_sid']
189
+ end
190
+
191
+ ##
192
+ # @return [String] A human readable description of the Inbound Processing Region assignments for this phone number.
193
+ def friendly_name
194
+ @properties['friendly_name']
195
+ end
196
+
197
+ ##
198
+ # @return [String] The Inbound Processing Region used for this phone number for voice.
199
+ def voice_region
200
+ @properties['voice_region']
201
+ end
202
+
203
+ ##
204
+ # @return [Time] The date that this phone number was assigned an Inbound Processing Region.
205
+ def date_created
206
+ @properties['date_created']
207
+ end
208
+
209
+ ##
210
+ # @return [Time] The date that the Inbound Processing Region was updated for this phone number.
211
+ def date_updated
212
+ @properties['date_updated']
213
+ end
214
+
215
+ ##
216
+ # Create the PhoneNumberInstance
217
+ # @param [String] voice_region The Inbound Processing Region used for this phone
218
+ # number for voice
219
+ # @param [String] friendly_name A human readable description of this resource, up
220
+ # to 64 characters.
221
+ # @return [PhoneNumberInstance] Created PhoneNumberInstance
222
+ def create(voice_region: :unset, friendly_name: :unset)
223
+ context.create(voice_region: voice_region, friendly_name: friendly_name, )
224
+ end
225
+
226
+ ##
227
+ # Update the PhoneNumberInstance
228
+ # @param [String] voice_region The Inbound Processing Region used for this phone
229
+ # number for voice
230
+ # @param [String] friendly_name A human readable description of this resource, up
231
+ # to 64 characters.
232
+ # @return [PhoneNumberInstance] Updated PhoneNumberInstance
233
+ def update(voice_region: nil, friendly_name: nil)
234
+ context.update(voice_region: voice_region, friendly_name: friendly_name, )
235
+ end
236
+
237
+ ##
238
+ # Fetch the PhoneNumberInstance
239
+ # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
240
+ def fetch
241
+ context.fetch
242
+ end
243
+
244
+ ##
245
+ # Provide a user friendly representation
246
+ def to_s
247
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
248
+ "<Twilio.Routes.V2.PhoneNumberInstance #{values}>"
249
+ end
250
+
251
+ ##
252
+ # Provide a detailed, user friendly representation
253
+ def inspect
254
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
255
+ "<Twilio.Routes.V2.PhoneNumberInstance #{values}>"
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,253 @@
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 Routes < Domain
12
+ class V2 < Version
13
+ class SipDomainList < ListResource
14
+ ##
15
+ # Initialize the SipDomainList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SipDomainList] SipDomainList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Routes.V2.SipDomainList>'
29
+ end
30
+ end
31
+
32
+ class SipDomainPage < Page
33
+ ##
34
+ # Initialize the SipDomainPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [SipDomainPage] SipDomainPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of SipDomainInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SipDomainInstance] SipDomainInstance
50
+ def get_instance(payload)
51
+ SipDomainInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Routes.V2.SipDomainPage>'
58
+ end
59
+ end
60
+
61
+ class SipDomainContext < InstanceContext
62
+ ##
63
+ # Initialize the SipDomainContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] sip_domain The sip_domain
66
+ # @return [SipDomainContext] SipDomainContext
67
+ def initialize(version, sip_domain)
68
+ super(version)
69
+
70
+ # Path Solution
71
+ @solution = {sip_domain: sip_domain, }
72
+ @uri = "/SipDomains/#{@solution[:sip_domain]}"
73
+ end
74
+
75
+ ##
76
+ # Create the SipDomainInstance
77
+ # @param [String] voice_region The voice_region
78
+ # @param [String] friendly_name The friendly_name
79
+ # @return [SipDomainInstance] Created SipDomainInstance
80
+ def create(voice_region: :unset, friendly_name: :unset)
81
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
82
+
83
+ payload = @version.create('POST', @uri, data: data)
84
+
85
+ SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
86
+ end
87
+
88
+ ##
89
+ # Update the SipDomainInstance
90
+ # @param [String] voice_region The voice_region
91
+ # @param [String] friendly_name The friendly_name
92
+ # @return [SipDomainInstance] Updated SipDomainInstance
93
+ def update(voice_region: :unset, friendly_name: :unset)
94
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
95
+
96
+ payload = @version.update('POST', @uri, data: data)
97
+
98
+ SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
99
+ end
100
+
101
+ ##
102
+ # Fetch the SipDomainInstance
103
+ # @return [SipDomainInstance] Fetched SipDomainInstance
104
+ def fetch
105
+ payload = @version.fetch('GET', @uri)
106
+
107
+ SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
108
+ end
109
+
110
+ ##
111
+ # Provide a user friendly representation
112
+ def to_s
113
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
114
+ "#<Twilio.Routes.V2.SipDomainContext #{context}>"
115
+ end
116
+
117
+ ##
118
+ # Provide a detailed, user friendly representation
119
+ def inspect
120
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
121
+ "#<Twilio.Routes.V2.SipDomainContext #{context}>"
122
+ end
123
+ end
124
+
125
+ class SipDomainInstance < InstanceResource
126
+ ##
127
+ # Initialize the SipDomainInstance
128
+ # @param [Version] version Version that contains the resource
129
+ # @param [Hash] payload payload that contains response from Twilio
130
+ # @param [String] sip_domain The sip_domain
131
+ # @return [SipDomainInstance] SipDomainInstance
132
+ def initialize(version, payload, sip_domain: nil)
133
+ super(version)
134
+
135
+ # Marshaled Properties
136
+ @properties = {
137
+ 'sip_domain' => payload['sip_domain'],
138
+ 'url' => payload['url'],
139
+ 'sid' => payload['sid'],
140
+ 'account_sid' => payload['account_sid'],
141
+ 'friendly_name' => payload['friendly_name'],
142
+ 'voice_region' => payload['voice_region'],
143
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
144
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
145
+ }
146
+
147
+ # Context
148
+ @instance_context = nil
149
+ @params = {'sip_domain' => sip_domain || @properties['sip_domain'], }
150
+ end
151
+
152
+ ##
153
+ # Generate an instance context for the instance, the context is capable of
154
+ # performing various actions. All instance actions are proxied to the context
155
+ # @return [SipDomainContext] SipDomainContext for this SipDomainInstance
156
+ def context
157
+ unless @instance_context
158
+ @instance_context = SipDomainContext.new(@version, @params['sip_domain'], )
159
+ end
160
+ @instance_context
161
+ end
162
+
163
+ ##
164
+ # @return [String] The sip_domain
165
+ def sip_domain
166
+ @properties['sip_domain']
167
+ end
168
+
169
+ ##
170
+ # @return [String] The url
171
+ def url
172
+ @properties['url']
173
+ end
174
+
175
+ ##
176
+ # @return [String] The sid
177
+ def sid
178
+ @properties['sid']
179
+ end
180
+
181
+ ##
182
+ # @return [String] The account_sid
183
+ def account_sid
184
+ @properties['account_sid']
185
+ end
186
+
187
+ ##
188
+ # @return [String] The friendly_name
189
+ def friendly_name
190
+ @properties['friendly_name']
191
+ end
192
+
193
+ ##
194
+ # @return [String] The voice_region
195
+ def voice_region
196
+ @properties['voice_region']
197
+ end
198
+
199
+ ##
200
+ # @return [Time] The date_created
201
+ def date_created
202
+ @properties['date_created']
203
+ end
204
+
205
+ ##
206
+ # @return [Time] The date_updated
207
+ def date_updated
208
+ @properties['date_updated']
209
+ end
210
+
211
+ ##
212
+ # Create the SipDomainInstance
213
+ # @param [String] voice_region The voice_region
214
+ # @param [String] friendly_name The friendly_name
215
+ # @return [SipDomainInstance] Created SipDomainInstance
216
+ def create(voice_region: :unset, friendly_name: :unset)
217
+ context.create(voice_region: voice_region, friendly_name: friendly_name, )
218
+ end
219
+
220
+ ##
221
+ # Update the SipDomainInstance
222
+ # @param [String] voice_region The voice_region
223
+ # @param [String] friendly_name The friendly_name
224
+ # @return [SipDomainInstance] Updated SipDomainInstance
225
+ def update(voice_region: :unset, friendly_name: :unset)
226
+ context.update(voice_region: voice_region, friendly_name: friendly_name, )
227
+ end
228
+
229
+ ##
230
+ # Fetch the SipDomainInstance
231
+ # @return [SipDomainInstance] Fetched SipDomainInstance
232
+ def fetch
233
+ context.fetch
234
+ end
235
+
236
+ ##
237
+ # Provide a user friendly representation
238
+ def to_s
239
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
240
+ "<Twilio.Routes.V2.SipDomainInstance #{values}>"
241
+ end
242
+
243
+ ##
244
+ # Provide a detailed, user friendly representation
245
+ def inspect
246
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
247
+ "<Twilio.Routes.V2.SipDomainInstance #{values}>"
248
+ end
249
+ end
250
+ end
251
+ end
252
+ end
253
+ end