twilio-ruby 5.70.0 → 5.72.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +57 -0
  3. data/Makefile +6 -2
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +34 -1
  6. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +4 -4
  7. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +3 -3
  8. data/lib/twilio-ruby/rest/client.rb +14 -0
  9. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  10. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +4 -5
  11. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +559 -0
  12. data/lib/twilio-ruby/rest/messaging/v1.rb +16 -0
  13. data/lib/twilio-ruby/rest/messaging.rb +8 -0
  14. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +305 -0
  15. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +332 -0
  16. data/lib/twilio-ruby/rest/microvisor/v1.rb +60 -0
  17. data/lib/twilio-ruby/rest/microvisor.rb +54 -0
  18. data/lib/twilio-ruby/rest/preview.rb +0 -25
  19. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +235 -0
  20. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +231 -0
  21. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +235 -0
  22. data/lib/twilio-ruby/rest/routes/v2.rb +76 -0
  23. data/lib/twilio-ruby/rest/routes.rb +62 -0
  24. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +16 -6
  25. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +215 -0
  26. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -8
  27. data/lib/twilio-ruby/rest/verify/v2.rb +18 -0
  28. data/lib/twilio-ruby/rest/verify.rb +8 -0
  29. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_anonymize.rb +240 -0
  30. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +16 -0
  31. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  32. data/lib/twilio-ruby/twiml/voice_response.rb +19 -5
  33. data/lib/twilio-ruby/version.rb +1 -1
  34. metadata +14 -8
  35. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -294
  36. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +0 -275
  37. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +0 -249
  38. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -251
  39. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -234
  40. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -62
@@ -0,0 +1,235 @@
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 TrunkList < ListResource
14
+ ##
15
+ # Initialize the TrunkList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [TrunkList] TrunkList
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.TrunkList>'
29
+ end
30
+ end
31
+
32
+ class TrunkPage < Page
33
+ ##
34
+ # Initialize the TrunkPage
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 [TrunkPage] TrunkPage
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 TrunkInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [TrunkInstance] TrunkInstance
50
+ def get_instance(payload)
51
+ TrunkInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Routes.V2.TrunkPage>'
58
+ end
59
+ end
60
+
61
+ class TrunkContext < InstanceContext
62
+ ##
63
+ # Initialize the TrunkContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [String] sip_trunk_domain The absolute URL of the SIP Trunk
66
+ # @return [TrunkContext] TrunkContext
67
+ def initialize(version, sip_trunk_domain)
68
+ super(version)
69
+
70
+ # Path Solution
71
+ @solution = {sip_trunk_domain: sip_trunk_domain, }
72
+ @uri = "/Trunks/#{@solution[:sip_trunk_domain]}"
73
+ end
74
+
75
+ ##
76
+ # Update the TrunkInstance
77
+ # @param [String] voice_region The Inbound Processing Region used for this SIP
78
+ # Trunk for voice
79
+ # @param [String] friendly_name A human readable description of this resource, up
80
+ # to 64 characters.
81
+ # @return [TrunkInstance] Updated TrunkInstance
82
+ def update(voice_region: :unset, friendly_name: :unset)
83
+ data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })
84
+
85
+ payload = @version.update('POST', @uri, data: data)
86
+
87
+ TrunkInstance.new(@version, payload, sip_trunk_domain: @solution[:sip_trunk_domain], )
88
+ end
89
+
90
+ ##
91
+ # Fetch the TrunkInstance
92
+ # @return [TrunkInstance] Fetched TrunkInstance
93
+ def fetch
94
+ payload = @version.fetch('GET', @uri)
95
+
96
+ TrunkInstance.new(@version, payload, sip_trunk_domain: @solution[:sip_trunk_domain], )
97
+ end
98
+
99
+ ##
100
+ # Provide a user friendly representation
101
+ def to_s
102
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
103
+ "#<Twilio.Routes.V2.TrunkContext #{context}>"
104
+ end
105
+
106
+ ##
107
+ # Provide a detailed, user friendly representation
108
+ def inspect
109
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
110
+ "#<Twilio.Routes.V2.TrunkContext #{context}>"
111
+ end
112
+ end
113
+
114
+ class TrunkInstance < InstanceResource
115
+ ##
116
+ # Initialize the TrunkInstance
117
+ # @param [Version] version Version that contains the resource
118
+ # @param [Hash] payload payload that contains response from Twilio
119
+ # @param [String] sip_trunk_domain The absolute URL of the SIP Trunk
120
+ # @return [TrunkInstance] TrunkInstance
121
+ def initialize(version, payload, sip_trunk_domain: nil)
122
+ super(version)
123
+
124
+ # Marshaled Properties
125
+ @properties = {
126
+ 'sip_trunk_domain' => payload['sip_trunk_domain'],
127
+ 'url' => payload['url'],
128
+ 'sid' => payload['sid'],
129
+ 'account_sid' => payload['account_sid'],
130
+ 'friendly_name' => payload['friendly_name'],
131
+ 'voice_region' => payload['voice_region'],
132
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
133
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {'sip_trunk_domain' => sip_trunk_domain || @properties['sip_trunk_domain'], }
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [TrunkContext] TrunkContext for this TrunkInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = TrunkContext.new(@version, @params['sip_trunk_domain'], )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The SIP Trunk
154
+ def sip_trunk_domain
155
+ @properties['sip_trunk_domain']
156
+ end
157
+
158
+ ##
159
+ # @return [String] The absolute URL of the resource
160
+ def url
161
+ @properties['url']
162
+ end
163
+
164
+ ##
165
+ # @return [String] A string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
166
+ def sid
167
+ @properties['sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] Account Sid.
172
+ def account_sid
173
+ @properties['account_sid']
174
+ end
175
+
176
+ ##
177
+ # @return [String] A human readable description of the Inbound Processing Region assignments for this SIP Trunk.
178
+ def friendly_name
179
+ @properties['friendly_name']
180
+ end
181
+
182
+ ##
183
+ # @return [String] The Inbound Processing Region used for this SIP Trunk for voice.
184
+ def voice_region
185
+ @properties['voice_region']
186
+ end
187
+
188
+ ##
189
+ # @return [Time] The date that this SIP Trunk was assigned an Inbound Processing Region.
190
+ def date_created
191
+ @properties['date_created']
192
+ end
193
+
194
+ ##
195
+ # @return [Time] The date that the Inbound Processing Region was updated for this SIP Trunk.
196
+ def date_updated
197
+ @properties['date_updated']
198
+ end
199
+
200
+ ##
201
+ # Update the TrunkInstance
202
+ # @param [String] voice_region The Inbound Processing Region used for this SIP
203
+ # Trunk for voice
204
+ # @param [String] friendly_name A human readable description of this resource, up
205
+ # to 64 characters.
206
+ # @return [TrunkInstance] Updated TrunkInstance
207
+ def update(voice_region: :unset, friendly_name: :unset)
208
+ context.update(voice_region: voice_region, friendly_name: friendly_name, )
209
+ end
210
+
211
+ ##
212
+ # Fetch the TrunkInstance
213
+ # @return [TrunkInstance] Fetched TrunkInstance
214
+ def fetch
215
+ context.fetch
216
+ end
217
+
218
+ ##
219
+ # Provide a user friendly representation
220
+ def to_s
221
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
222
+ "<Twilio.Routes.V2.TrunkInstance #{values}>"
223
+ end
224
+
225
+ ##
226
+ # Provide a detailed, user friendly representation
227
+ def inspect
228
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
229
+ "<Twilio.Routes.V2.TrunkInstance #{values}>"
230
+ end
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
@@ -0,0 +1,76 @@
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
12
+ class V2 < Version
13
+ ##
14
+ # Initialize the V2 version of Routes
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v2'
18
+ @phone_numbers = nil
19
+ @sip_domains = nil
20
+ @trunks = nil
21
+ end
22
+
23
+ ##
24
+ # @param [String] phone_number The phone number in E.164 format
25
+ # @return [Twilio::REST::Routes::V2::PhoneNumberContext] if phone_number was passed.
26
+ # @return [Twilio::REST::Routes::V2::PhoneNumberList]
27
+ def phone_numbers(phone_number=:unset)
28
+ if phone_number.nil?
29
+ raise ArgumentError, 'phone_number cannot be nil'
30
+ end
31
+ if phone_number == :unset
32
+ @phone_numbers ||= PhoneNumberList.new self
33
+ else
34
+ PhoneNumberContext.new(self, phone_number)
35
+ end
36
+ end
37
+
38
+ ##
39
+ # @param [String] sip_domain The sip_domain
40
+ # @return [Twilio::REST::Routes::V2::SipDomainContext] if sip_domain was passed.
41
+ # @return [Twilio::REST::Routes::V2::SipDomainList]
42
+ def sip_domains(sip_domain=:unset)
43
+ if sip_domain.nil?
44
+ raise ArgumentError, 'sip_domain cannot be nil'
45
+ end
46
+ if sip_domain == :unset
47
+ @sip_domains ||= SipDomainList.new self
48
+ else
49
+ SipDomainContext.new(self, sip_domain)
50
+ end
51
+ end
52
+
53
+ ##
54
+ # @param [String] sip_trunk_domain The absolute URL of the SIP Trunk
55
+ # @return [Twilio::REST::Routes::V2::TrunkContext] if sip_trunk_domain was passed.
56
+ # @return [Twilio::REST::Routes::V2::TrunkList]
57
+ def trunks(sip_trunk_domain=:unset)
58
+ if sip_trunk_domain.nil?
59
+ raise ArgumentError, 'sip_trunk_domain cannot be nil'
60
+ end
61
+ if sip_trunk_domain == :unset
62
+ @trunks ||= TrunkList.new self
63
+ else
64
+ TrunkContext.new(self, sip_trunk_domain)
65
+ end
66
+ end
67
+
68
+ ##
69
+ # Provide a user friendly representation
70
+ def to_s
71
+ '<Twilio::REST::Routes::V2>'
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,62 @@
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
+ ##
13
+ # Initialize the Routes Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://routes.twilio.com'
18
+ @host = 'routes.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v2 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v2 of routes
27
+ def v2
28
+ @v2 ||= V2.new self
29
+ end
30
+
31
+ ##
32
+ # @param [String] phone_number The phone number in E.164 format
33
+ # @return [Twilio::REST::Routes::V2::PhoneNumberInstance] if phone_number was passed.
34
+ # @return [Twilio::REST::Routes::V2::PhoneNumberList]
35
+ def phone_numbers(phone_number=:unset)
36
+ self.v2.phone_numbers(phone_number)
37
+ end
38
+
39
+ ##
40
+ # @param [String] sip_domain The sip_domain
41
+ # @return [Twilio::REST::Routes::V2::SipDomainInstance] if sip_domain was passed.
42
+ # @return [Twilio::REST::Routes::V2::SipDomainList]
43
+ def sip_domains(sip_domain=:unset)
44
+ self.v2.sip_domains(sip_domain)
45
+ end
46
+
47
+ ##
48
+ # @param [String] sip_trunk_domain The absolute URL of the SIP Trunk
49
+ # @return [Twilio::REST::Routes::V2::TrunkInstance] if sip_trunk_domain was passed.
50
+ # @return [Twilio::REST::Routes::V2::TrunkList]
51
+ def trunks(sip_trunk_domain=:unset)
52
+ self.v2.trunks(sip_trunk_domain)
53
+ end
54
+
55
+ ##
56
+ # Provide a user friendly representation
57
+ def to_s
58
+ '#<Twilio::REST::Routes>'
59
+ end
60
+ end
61
+ end
62
+ end
@@ -36,9 +36,9 @@ module Twilio
36
36
  # @param [Boolean] data_enabled Defines whether SIMs in the Fleet are capable of
37
37
  # using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`.
38
38
  # @param [String] data_limit The total data usage (download and upload combined)
39
- # in Megabytes that each Sim resource assigned to the Fleet resource can consume
40
- # during a billing period (normally one month). Value must be between 1MB (1) and
41
- # 2TB (2,000,000). Defaults to 1GB (1,000).
39
+ # in Megabytes that each Super SIM assigned to the Fleet can consume during a
40
+ # billing period (normally one month). Value must be between 1MB (1) and 2TB
41
+ # (2,000,000). Defaults to 1GB (1,000).
42
42
  # @param [String] ip_commands_url The URL that will receive a webhook when a Super
43
43
  # SIM in the Fleet is used to send an IP Command from your device to a special IP
44
44
  # address. Your server should respond with an HTTP status code in the 200 range;
@@ -254,8 +254,12 @@ module Twilio
254
254
  # @param [String] sms_commands_method A string representing the HTTP method to use
255
255
  # when making a request to `sms_commands_url`. Can be one of `POST` or `GET`.
256
256
  # Defaults to `POST`.
257
+ # @param [String] data_limit The total data usage (download and upload combined)
258
+ # in Megabytes that each Super SIM assigned to the Fleet can consume during a
259
+ # billing period (normally one month). Value must be between 1MB (1) and 2TB
260
+ # (2,000,000). Defaults to 1GB (1,000).
257
261
  # @return [FleetInstance] Updated FleetInstance
258
- def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
262
+ def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset, data_limit: :unset)
259
263
  data = Twilio::Values.of({
260
264
  'UniqueName' => unique_name,
261
265
  'NetworkAccessProfile' => network_access_profile,
@@ -263,6 +267,7 @@ module Twilio
263
267
  'IpCommandsMethod' => ip_commands_method,
264
268
  'SmsCommandsUrl' => sms_commands_url,
265
269
  'SmsCommandsMethod' => sms_commands_method,
270
+ 'DataLimit' => data_limit,
266
271
  })
267
272
 
268
273
  payload = @version.update('POST', @uri, data: data)
@@ -375,7 +380,7 @@ module Twilio
375
380
  end
376
381
 
377
382
  ##
378
- # @return [String] The total data usage (download and upload combined) in Megabytes that each Sim resource assigned to the Fleet resource can consume
383
+ # @return [String] The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume
379
384
  def data_limit
380
385
  @properties['data_limit']
381
386
  end
@@ -451,8 +456,12 @@ module Twilio
451
456
  # @param [String] sms_commands_method A string representing the HTTP method to use
452
457
  # when making a request to `sms_commands_url`. Can be one of `POST` or `GET`.
453
458
  # Defaults to `POST`.
459
+ # @param [String] data_limit The total data usage (download and upload combined)
460
+ # in Megabytes that each Super SIM assigned to the Fleet can consume during a
461
+ # billing period (normally one month). Value must be between 1MB (1) and 2TB
462
+ # (2,000,000). Defaults to 1GB (1,000).
454
463
  # @return [FleetInstance] Updated FleetInstance
455
- def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
464
+ def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset, data_limit: :unset)
456
465
  context.update(
457
466
  unique_name: unique_name,
458
467
  network_access_profile: network_access_profile,
@@ -460,6 +469,7 @@ module Twilio
460
469
  ip_commands_method: ip_commands_method,
461
470
  sms_commands_url: sms_commands_url,
462
471
  sms_commands_method: sms_commands_method,
472
+ data_limit: data_limit,
463
473
  )
464
474
  end
465
475
 
@@ -0,0 +1,215 @@
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 Verify < Domain
12
+ class V2 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class SafelistList < ListResource
16
+ ##
17
+ # Initialize the SafelistList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [SafelistList] SafelistList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/SafeList/Numbers"
26
+ end
27
+
28
+ ##
29
+ # Create the SafelistInstance
30
+ # @param [String] phone_number The phone number to be added in SafeList. Phone
31
+ # numbers must be in {E.164
32
+ # format}[https://www.twilio.com/docs/glossary/what-e164].
33
+ # @return [SafelistInstance] Created SafelistInstance
34
+ def create(phone_number: nil)
35
+ data = Twilio::Values.of({'PhoneNumber' => phone_number, })
36
+
37
+ payload = @version.create('POST', @uri, data: data)
38
+
39
+ SafelistInstance.new(@version, payload, )
40
+ end
41
+
42
+ ##
43
+ # Provide a user friendly representation
44
+ def to_s
45
+ '#<Twilio.Verify.V2.SafelistList>'
46
+ end
47
+ end
48
+
49
+ ##
50
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
51
+ class SafelistPage < Page
52
+ ##
53
+ # Initialize the SafelistPage
54
+ # @param [Version] version Version that contains the resource
55
+ # @param [Response] response Response from the API
56
+ # @param [Hash] solution Path solution for the resource
57
+ # @return [SafelistPage] SafelistPage
58
+ def initialize(version, response, solution)
59
+ super(version, response)
60
+
61
+ # Path Solution
62
+ @solution = solution
63
+ end
64
+
65
+ ##
66
+ # Build an instance of SafelistInstance
67
+ # @param [Hash] payload Payload response from the API
68
+ # @return [SafelistInstance] SafelistInstance
69
+ def get_instance(payload)
70
+ SafelistInstance.new(@version, payload, )
71
+ end
72
+
73
+ ##
74
+ # Provide a user friendly representation
75
+ def to_s
76
+ '<Twilio.Verify.V2.SafelistPage>'
77
+ end
78
+ end
79
+
80
+ ##
81
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
82
+ class SafelistContext < InstanceContext
83
+ ##
84
+ # Initialize the SafelistContext
85
+ # @param [Version] version Version that contains the resource
86
+ # @param [String] phone_number The phone number to be fetched from SafeList. Phone
87
+ # numbers must be in {E.164
88
+ # format}[https://www.twilio.com/docs/glossary/what-e164].
89
+ # @return [SafelistContext] SafelistContext
90
+ def initialize(version, phone_number)
91
+ super(version)
92
+
93
+ # Path Solution
94
+ @solution = {phone_number: phone_number, }
95
+ @uri = "/SafeList/Numbers/#{@solution[:phone_number]}"
96
+ end
97
+
98
+ ##
99
+ # Fetch the SafelistInstance
100
+ # @return [SafelistInstance] Fetched SafelistInstance
101
+ def fetch
102
+ payload = @version.fetch('GET', @uri)
103
+
104
+ SafelistInstance.new(@version, payload, phone_number: @solution[:phone_number], )
105
+ end
106
+
107
+ ##
108
+ # Delete the SafelistInstance
109
+ # @return [Boolean] true if delete succeeds, false otherwise
110
+ def delete
111
+ @version.delete('DELETE', @uri)
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.Verify.V2.SafelistContext #{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.Verify.V2.SafelistContext #{context}>"
126
+ end
127
+ end
128
+
129
+ ##
130
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
131
+ class SafelistInstance < InstanceResource
132
+ ##
133
+ # Initialize the SafelistInstance
134
+ # @param [Version] version Version that contains the resource
135
+ # @param [Hash] payload payload that contains response from Twilio
136
+ # @param [String] phone_number The phone number to be fetched from SafeList. Phone
137
+ # numbers must be in {E.164
138
+ # format}[https://www.twilio.com/docs/glossary/what-e164].
139
+ # @return [SafelistInstance] SafelistInstance
140
+ def initialize(version, payload, phone_number: nil)
141
+ super(version)
142
+
143
+ # Marshaled Properties
144
+ @properties = {
145
+ 'sid' => payload['sid'],
146
+ 'phone_number' => payload['phone_number'],
147
+ 'url' => payload['url'],
148
+ }
149
+
150
+ # Context
151
+ @instance_context = nil
152
+ @params = {'phone_number' => phone_number || @properties['phone_number'], }
153
+ end
154
+
155
+ ##
156
+ # Generate an instance context for the instance, the context is capable of
157
+ # performing various actions. All instance actions are proxied to the context
158
+ # @return [SafelistContext] SafelistContext for this SafelistInstance
159
+ def context
160
+ unless @instance_context
161
+ @instance_context = SafelistContext.new(@version, @params['phone_number'], )
162
+ end
163
+ @instance_context
164
+ end
165
+
166
+ ##
167
+ # @return [String] The unique string that identifies the resource.
168
+ def sid
169
+ @properties['sid']
170
+ end
171
+
172
+ ##
173
+ # @return [String] The phone number in SafeList.
174
+ def phone_number
175
+ @properties['phone_number']
176
+ end
177
+
178
+ ##
179
+ # @return [String] The absolute URL of the SafeList resource.
180
+ def url
181
+ @properties['url']
182
+ end
183
+
184
+ ##
185
+ # Fetch the SafelistInstance
186
+ # @return [SafelistInstance] Fetched SafelistInstance
187
+ def fetch
188
+ context.fetch
189
+ end
190
+
191
+ ##
192
+ # Delete the SafelistInstance
193
+ # @return [Boolean] true if delete succeeds, false otherwise
194
+ def delete
195
+ context.delete
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
202
+ "<Twilio.Verify.V2.SafelistInstance #{values}>"
203
+ end
204
+
205
+ ##
206
+ # Provide a detailed, user friendly representation
207
+ def inspect
208
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
209
+ "<Twilio.Verify.V2.SafelistInstance #{values}>"
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -32,9 +32,9 @@ module Twilio
32
32
  # @param [String] to The phone number or
33
33
  # {email}[https://www.twilio.com/docs/verify/email] to verify. Phone numbers must
34
34
  # be in {E.164 format}[https://www.twilio.com/docs/glossary/what-e164].
35
- # @param [String] channel The verification method to use. Can be:
36
- # {`email`}[https://www.twilio.com/docs/verify/email], `sms`, `whatsapp` or
37
- # `call`.
35
+ # @param [String] channel The verification method to use. One of:
36
+ # {`email`}[https://www.twilio.com/docs/verify/email], `sms`, `whatsapp`, `call`,
37
+ # or `sna`.
38
38
  # @param [String] custom_friendly_name A custom user defined friendly name that
39
39
  # overwrites the existing one in the verification message
40
40
  # @param [String] custom_message The text of a custom message to use for the
@@ -43,11 +43,10 @@ module Twilio
43
43
  # for example, to dial an extension. For more information, see the Programmable
44
44
  # Voice documentation of
45
45
  # {sendDigits}[https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits].
46
- # @param [String] locale The locale to use for the verification SMS, WhatsApp or
47
- # call. Can be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `en-GB`, `es`,
48
- # `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`,
49
- # `pl`, `pt`, `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or
50
- # `zh-HK.`
46
+ # @param [String] locale Locale will automatically resolve based on phone number
47
+ # country code for SMS, WhatsApp and call channel verifications. This parameter
48
+ # will override the automatic locale. {See supported languages and more
49
+ # information here.}[https://www.twilio.com/docs/verify/supported-languages].
51
50
  # @param [String] custom_code A pre-generated code to use for verification. The
52
51
  # code can be between 4 and 10 characters, inclusive.
53
52
  # @param [String] amount The amount of the associated PSD2 compliant transaction.