twilio-ruby 5.28.0 → 5.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +11 -6
  3. data/CHANGES.md +33 -0
  4. data/README.md +3 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +18 -20
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +7 -6
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +7 -6
  8. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -4
  9. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +0 -14
  10. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +1 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +6 -4
  12. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +9 -6
  13. data/lib/twilio-ruby/rest/authy.rb +8 -8
  14. data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
  15. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +6 -3
  16. data/lib/twilio-ruby/rest/flex_api.rb +15 -15
  17. data/lib/twilio-ruby/rest/flex_api/v1.rb +20 -20
  18. data/lib/twilio-ruby/rest/messaging.rb +9 -9
  19. data/lib/twilio-ruby/rest/messaging/v1.rb +13 -13
  20. data/lib/twilio-ruby/rest/preview.rb +20 -20
  21. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +38 -0
  22. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +298 -0
  23. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +232 -0
  24. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  25. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +14 -14
  26. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +40 -5
  27. data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +7 -7
  28. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +51 -51
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/device.rb +10 -10
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +96 -19
  31. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  32. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +8 -2
  33. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +10 -6
  34. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +10 -6
  35. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +271 -176
  36. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +282 -137
  37. data/lib/twilio-ruby/rest/video.rb +9 -9
  38. data/lib/twilio-ruby/rest/video/v1.rb +15 -15
  39. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +2 -1
  40. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +9 -7
  41. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +3 -3
  42. data/lib/twilio-ruby/rest/wireless.rb +6 -6
  43. data/lib/twilio-ruby/rest/wireless/v1.rb +8 -8
  44. data/lib/twilio-ruby/rest/wireless/v1/command.rb +5 -4
  45. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -5
  46. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +114 -98
  47. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +4 -4
  48. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +16 -10
  49. data/lib/twilio-ruby/security/request_validator.rb +61 -8
  50. data/lib/twilio-ruby/version.rb +1 -1
  51. data/spec/integration/api/v2010/account/message_spec.rb +4 -4
  52. data/spec/integration/api/v2010/account/notification_spec.rb +0 -28
  53. data/spec/integration/conversations/v1/conversation/participant_spec.rb +27 -0
  54. data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +129 -0
  55. data/spec/integration/preview/bulk_exports/export/job_spec.rb +77 -0
  56. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +6 -1
  57. data/spec/integration/preview/trusted_comms/cps_spec.rb +1 -1
  58. data/spec/integration/preview/trusted_comms/current_call_spec.rb +10 -10
  59. data/spec/integration/preview/trusted_comms/device_spec.rb +1 -1
  60. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +15 -4
  61. data/spec/integration/wireless/v1/sim_spec.rb +84 -0
  62. data/spec/security/request_validator_spec.rb +41 -0
  63. metadata +9 -4
@@ -0,0 +1,232 @@
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 Preview < Domain
12
+ class BulkExports < Version
13
+ class ExportList < ListResource
14
+ ##
15
+ # 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.
16
+ class JobList < ListResource
17
+ ##
18
+ # Initialize the JobList
19
+ # @param [Version] version Version that contains the resource
20
+ # @return [JobList] JobList
21
+ def initialize(version)
22
+ super(version)
23
+
24
+ # Path Solution
25
+ @solution = {}
26
+ end
27
+
28
+ ##
29
+ # Provide a user friendly representation
30
+ def to_s
31
+ '#<Twilio.Preview.BulkExports.JobList>'
32
+ end
33
+ end
34
+
35
+ ##
36
+ # 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.
37
+ class JobPage < Page
38
+ ##
39
+ # Initialize the JobPage
40
+ # @param [Version] version Version that contains the resource
41
+ # @param [Response] response Response from the API
42
+ # @param [Hash] solution Path solution for the resource
43
+ # @return [JobPage] JobPage
44
+ def initialize(version, response, solution)
45
+ super(version, response)
46
+
47
+ # Path Solution
48
+ @solution = solution
49
+ end
50
+
51
+ ##
52
+ # Build an instance of JobInstance
53
+ # @param [Hash] payload Payload response from the API
54
+ # @return [JobInstance] JobInstance
55
+ def get_instance(payload)
56
+ JobInstance.new(@version, payload, )
57
+ end
58
+
59
+ ##
60
+ # Provide a user friendly representation
61
+ def to_s
62
+ '<Twilio.Preview.BulkExports.JobPage>'
63
+ end
64
+ end
65
+
66
+ ##
67
+ # 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.
68
+ class JobContext < InstanceContext
69
+ ##
70
+ # Initialize the JobContext
71
+ # @param [Version] version Version that contains the resource
72
+ # @param [String] job_sid The job_sid
73
+ # @return [JobContext] JobContext
74
+ def initialize(version, job_sid)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {job_sid: job_sid, }
79
+ @uri = "/Exports/Jobs/#{@solution[:job_sid]}"
80
+ end
81
+
82
+ ##
83
+ # Fetch a JobInstance
84
+ # @return [JobInstance] Fetched JobInstance
85
+ def fetch
86
+ params = Twilio::Values.of({})
87
+
88
+ payload = @version.fetch(
89
+ 'GET',
90
+ @uri,
91
+ params,
92
+ )
93
+
94
+ JobInstance.new(@version, payload, job_sid: @solution[:job_sid], )
95
+ end
96
+
97
+ ##
98
+ # Deletes the JobInstance
99
+ # @return [Boolean] true if delete succeeds, false otherwise
100
+ def delete
101
+ @version.delete('delete', @uri)
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Preview.BulkExports.JobContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Preview.BulkExports.JobContext #{context}>"
116
+ end
117
+ end
118
+
119
+ ##
120
+ # 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.
121
+ class JobInstance < InstanceResource
122
+ ##
123
+ # Initialize the JobInstance
124
+ # @param [Version] version Version that contains the resource
125
+ # @param [Hash] payload payload that contains response from Twilio
126
+ # @param [String] job_sid The job_sid
127
+ # @return [JobInstance] JobInstance
128
+ def initialize(version, payload, job_sid: nil)
129
+ super(version)
130
+
131
+ # Marshaled Properties
132
+ @properties = {
133
+ 'resource_type' => payload['resource_type'],
134
+ 'friendly_name' => payload['friendly_name'],
135
+ 'details' => payload['details'],
136
+ 'start_day' => payload['start_day'],
137
+ 'end_day' => payload['end_day'],
138
+ 'job_sid' => payload['job_sid'],
139
+ 'url' => payload['url'],
140
+ }
141
+
142
+ # Context
143
+ @instance_context = nil
144
+ @params = {'job_sid' => job_sid || @properties['job_sid'], }
145
+ end
146
+
147
+ ##
148
+ # Generate an instance context for the instance, the context is capable of
149
+ # performing various actions. All instance actions are proxied to the context
150
+ # @return [JobContext] JobContext for this JobInstance
151
+ def context
152
+ unless @instance_context
153
+ @instance_context = JobContext.new(@version, @params['job_sid'], )
154
+ end
155
+ @instance_context
156
+ end
157
+
158
+ ##
159
+ # @return [String] The type of communication – Messages, Calls
160
+ def resource_type
161
+ @properties['resource_type']
162
+ end
163
+
164
+ ##
165
+ # @return [String] The friendly name specified when creating the job
166
+ def friendly_name
167
+ @properties['friendly_name']
168
+ end
169
+
170
+ ##
171
+ # @return [Hash] This is a list of the completed, pending, or errored dates within the export time range, with one entry for each status with more than one day in that status
172
+ def details
173
+ @properties['details']
174
+ end
175
+
176
+ ##
177
+ # @return [String] The start time for the export specified when creating the job
178
+ def start_day
179
+ @properties['start_day']
180
+ end
181
+
182
+ ##
183
+ # @return [String] The end time for the export specified when creating the job
184
+ def end_day
185
+ @properties['end_day']
186
+ end
187
+
188
+ ##
189
+ # @return [String] The job_sid returned when the export was created
190
+ def job_sid
191
+ @properties['job_sid']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The url
196
+ def url
197
+ @properties['url']
198
+ end
199
+
200
+ ##
201
+ # Fetch a JobInstance
202
+ # @return [JobInstance] Fetched JobInstance
203
+ def fetch
204
+ context.fetch
205
+ end
206
+
207
+ ##
208
+ # Deletes the JobInstance
209
+ # @return [Boolean] true if delete succeeds, false otherwise
210
+ def delete
211
+ context.delete
212
+ end
213
+
214
+ ##
215
+ # Provide a user friendly representation
216
+ def to_s
217
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
218
+ "<Twilio.Preview.BulkExports.JobInstance #{values}>"
219
+ end
220
+
221
+ ##
222
+ # Provide a detailed, user friendly representation
223
+ def inspect
224
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
225
+ "<Twilio.Preview.BulkExports.JobInstance #{values}>"
226
+ end
227
+ end
228
+ end
229
+ end
230
+ end
231
+ end
232
+ end
@@ -15,37 +15,37 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'marketplace'
18
- @installed_add_ons = nil
19
18
  @available_add_ons = nil
19
+ @installed_add_ons = nil
20
20
  end
21
21
 
22
22
  ##
23
- # @param [String] sid The Installed Add-on Sid that uniquely identifies this
23
+ # @param [String] sid The Available Add-on Sid that uniquely identifies this
24
24
  # resource
25
- # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnContext] if sid was passed.
26
- # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
27
- def installed_add_ons(sid=:unset)
25
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnContext] if sid was passed.
26
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
27
+ def available_add_ons(sid=:unset)
28
28
  if sid.nil?
29
29
  raise ArgumentError, 'sid cannot be nil'
30
30
  elsif sid == :unset
31
- @installed_add_ons ||= InstalledAddOnList.new self
31
+ @available_add_ons ||= AvailableAddOnList.new self
32
32
  else
33
- InstalledAddOnContext.new(self, sid)
33
+ AvailableAddOnContext.new(self, sid)
34
34
  end
35
35
  end
36
36
 
37
37
  ##
38
- # @param [String] sid The Available Add-on Sid that uniquely identifies this
38
+ # @param [String] sid The Installed Add-on Sid that uniquely identifies this
39
39
  # resource
40
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnContext] if sid was passed.
41
- # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
42
- def available_add_ons(sid=:unset)
40
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnContext] if sid was passed.
41
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
42
+ def installed_add_ons(sid=:unset)
43
43
  if sid.nil?
44
44
  raise ArgumentError, 'sid cannot be nil'
45
45
  elsif sid == :unset
46
- @available_add_ons ||= AvailableAddOnList.new self
46
+ @installed_add_ons ||= InstalledAddOnList.new self
47
47
  else
48
- AvailableAddOnContext.new(self, sid)
48
+ InstalledAddOnContext.new(self, sid)
49
49
  end
50
50
  end
51
51
 
@@ -16,10 +16,10 @@ module Twilio
16
16
  super
17
17
  @version = 'TrustedComms'
18
18
  @branded_calls = nil
19
+ @cps = nil
20
+ @current_calls = nil
19
21
  @devices = nil
20
22
  @phone_calls = nil
21
- @current_calls = nil
22
- @cps = nil
23
23
  end
24
24
 
25
25
  ##
@@ -29,15 +29,9 @@ module Twilio
29
29
  end
30
30
 
31
31
  ##
32
- # @return [Twilio::REST::Preview::TrustedComms::DeviceContext]
33
- def devices
34
- @devices ||= DeviceList.new self
35
- end
36
-
37
- ##
38
- # @return [Twilio::REST::Preview::TrustedComms::PhoneCallContext]
39
- def phone_calls
40
- @phone_calls ||= PhoneCallList.new self
32
+ # @return [Twilio::REST::Preview::TrustedComms::CpsContext]
33
+ def cps
34
+ @cps ||= CpsContext.new self
41
35
  end
42
36
 
43
37
  ##
@@ -47,9 +41,15 @@ module Twilio
47
41
  end
48
42
 
49
43
  ##
50
- # @return [Twilio::REST::Preview::TrustedComms::CpsContext]
51
- def cps
52
- @cps ||= CpsContext.new self
44
+ # @return [Twilio::REST::Preview::TrustedComms::DeviceContext]
45
+ def devices
46
+ @devices ||= DeviceList.new self
47
+ end
48
+
49
+ ##
50
+ # @return [Twilio::REST::Preview::TrustedComms::PhoneCallContext]
51
+ def phone_calls
52
+ @phone_calls ||= PhoneCallList.new self
53
53
  end
54
54
 
55
55
  ##
@@ -29,11 +29,11 @@ module Twilio
29
29
  # Retrieve a single page of BrandedCallInstance records from the API.
30
30
  # Request is executed immediately.
31
31
  # @param [String] from The phone number to use as the caller id, given in [E.164
32
- # format](https://en.wikipedia.org/wiki/E.164). It must be a Twilio number that
33
- # has been set up as a Branded Number in the Business Profile section for your
34
- # account.
32
+ # format](https://www.twilio.com/docs/glossary/what-e164). It must be a Twilio
33
+ # number that has been set up as a Branded Number in the Business Profile section
34
+ # for your account.
35
35
  # @param [String] to The terminating Phone Number, given in [E.164
36
- # format](https://en.wikipedia.org/wiki/E.164).
36
+ # format](https://www.twilio.com/docs/glossary/what-e164).
37
37
  # @param [String] reason The business reason for this phone call that will appear
38
38
  # in the terminating device's screen. Max 50 characters.
39
39
  # @param [String] call_sid The Call sid this Branded Call should link to.
@@ -103,11 +103,16 @@ module Twilio
103
103
  @properties = {
104
104
  'account_sid' => payload['account_sid'],
105
105
  'bg_color' => payload['bg_color'],
106
+ 'brand_sid' => payload['brand_sid'],
107
+ 'branded_channel_sid' => payload['branded_channel_sid'],
108
+ 'business_sid' => payload['business_sid'],
109
+ 'call_sid' => payload['call_sid'],
106
110
  'caller' => payload['caller'],
107
111
  'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
108
112
  'font_color' => payload['font_color'],
109
113
  'from' => payload['from'],
110
114
  'logo' => payload['logo'],
115
+ 'phone_number_sid' => payload['phone_number_sid'],
111
116
  'reason' => payload['reason'],
112
117
  'sid' => payload['sid'],
113
118
  'status' => payload['status'],
@@ -129,6 +134,30 @@ module Twilio
129
134
  @properties['bg_color']
130
135
  end
131
136
 
137
+ ##
138
+ # @return [String] Brand Sid.
139
+ def brand_sid
140
+ @properties['brand_sid']
141
+ end
142
+
143
+ ##
144
+ # @return [String] Branded Channel Sid.
145
+ def branded_channel_sid
146
+ @properties['branded_channel_sid']
147
+ end
148
+
149
+ ##
150
+ # @return [String] Business Sid.
151
+ def business_sid
152
+ @properties['business_sid']
153
+ end
154
+
155
+ ##
156
+ # @return [String] A string that uniquely identifies this phone call.
157
+ def call_sid
158
+ @properties['call_sid']
159
+ end
160
+
132
161
  ##
133
162
  # @return [String] Caller name of the current phone call
134
163
  def caller
@@ -159,6 +188,12 @@ module Twilio
159
188
  @properties['logo']
160
189
  end
161
190
 
191
+ ##
192
+ # @return [String] Phone Number Sid.
193
+ def phone_number_sid
194
+ @properties['phone_number_sid']
195
+ end
196
+
162
197
  ##
163
198
  # @return [String] The business reason for this current phone call
164
199
  def reason
@@ -166,7 +201,7 @@ module Twilio
166
201
  end
167
202
 
168
203
  ##
169
- # @return [String] A string that uniquely identifies this current phone call.
204
+ # @return [String] A string that uniquely identifies this current branded phone call.
170
205
  def sid
171
206
  @properties['sid']
172
207
  end
@@ -120,8 +120,8 @@ module Twilio
120
120
 
121
121
  # Marshaled Properties
122
122
  @properties = {
123
- 'phone_number' => payload['phone_number'],
124
123
  'cps_url' => payload['cps_url'],
124
+ 'phone_number' => payload['phone_number'],
125
125
  'url' => payload['url'],
126
126
  }
127
127
 
@@ -141,18 +141,18 @@ module Twilio
141
141
  @instance_context
142
142
  end
143
143
 
144
- ##
145
- # @return [String] Phone number passed.
146
- def phone_number
147
- @properties['phone_number']
148
- end
149
-
150
144
  ##
151
145
  # @return [String] CPS URL of the phone number.
152
146
  def cps_url
153
147
  @properties['cps_url']
154
148
  end
155
149
 
150
+ ##
151
+ # @return [String] Phone number passed.
152
+ def phone_number
153
+ @properties['phone_number']
154
+ end
155
+
156
156
  ##
157
157
  # @return [String] The URL of this resource.
158
158
  def url