twilio-ruby 5.31.4 → 5.31.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -0
  3. data/.rubocop_todo.yml +0 -11
  4. data/CHANGES.md +38 -0
  5. data/README.md +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +27 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -1
  8. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  9. data/lib/twilio-ruby/rest/messaging.rb +0 -15
  10. data/lib/twilio-ruby/rest/messaging/v1.rb +0 -22
  11. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb +322 -0
  12. data/lib/twilio-ruby/rest/studio/v2/flow.rb +49 -0
  13. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +427 -0
  14. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +224 -0
  15. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +387 -0
  16. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +239 -0
  17. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +215 -0
  18. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +10 -3
  19. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +7 -0
  20. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +14 -0
  21. data/lib/twilio-ruby/rest/verify/v2/service.rb +5 -3
  22. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +5 -4
  23. data/lib/twilio-ruby/version.rb +1 -1
  24. data/spec/integration/api/v2010/account/call_spec.rb +30 -10
  25. data/spec/integration/api/v2010/account/conference/participant_spec.rb +29 -0
  26. data/spec/integration/api/v2010/account/notification_spec.rb +1 -1
  27. data/spec/integration/api/v2010/account_spec.rb +45 -0
  28. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  29. data/spec/integration/numbers/v2/regulatory_compliance/regulation_spec.rb +183 -0
  30. data/spec/integration/studio/v2/flow/execution/execution_context_spec.rb +51 -0
  31. data/spec/integration/studio/v2/flow/execution/execution_step/execution_step_context_spec.rb +54 -0
  32. data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +101 -0
  33. data/spec/integration/studio/v2/flow/execution_spec.rb +169 -0
  34. data/spec/integration/studio/v2/flow/test_user_spec.rb +86 -0
  35. data/spec/integration/studio/v2/flow_spec.rb +16 -4
  36. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +6 -0
  37. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +2 -0
  38. data/spec/integration/taskrouter/v1/workspace/task_spec.rb +4 -0
  39. data/twilio-ruby.gemspec +1 -1
  40. metadata +22 -19
  41. data/lib/twilio-ruby/rest/messaging/v1/session.rb +0 -513
  42. data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +0 -439
  43. data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +0 -458
  44. data/lib/twilio-ruby/rest/messaging/v1/session/webhook.rb +0 -444
  45. data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +0 -299
  46. data/spec/integration/messaging/v1/session/message_spec.rb +0 -238
  47. data/spec/integration/messaging/v1/session/participant_spec.rb +0 -256
  48. data/spec/integration/messaging/v1/session/webhook_spec.rb +0 -300
  49. data/spec/integration/messaging/v1/session_spec.rb +0 -227
  50. data/spec/integration/messaging/v1/webhook_spec.rb +0 -94
@@ -0,0 +1,239 @@
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 Studio < Domain
12
+ class V2 < Version
13
+ class FlowContext < InstanceContext
14
+ class ExecutionContext < InstanceContext
15
+ class ExecutionStepContext < InstanceContext
16
+ ##
17
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
18
+ class ExecutionStepContextList < ListResource
19
+ ##
20
+ # Initialize the ExecutionStepContextList
21
+ # @param [Version] version Version that contains the resource
22
+ # @param [String] flow_sid The flow_sid
23
+ # @param [String] execution_sid The execution_sid
24
+ # @param [String] step_sid The step_sid
25
+ # @return [ExecutionStepContextList] ExecutionStepContextList
26
+ def initialize(version, flow_sid: nil, execution_sid: nil, step_sid: nil)
27
+ super(version)
28
+
29
+ # Path Solution
30
+ @solution = {flow_sid: flow_sid, execution_sid: execution_sid, step_sid: step_sid}
31
+ end
32
+
33
+ ##
34
+ # Provide a user friendly representation
35
+ def to_s
36
+ '#<Twilio.Studio.V2.ExecutionStepContextList>'
37
+ end
38
+ end
39
+
40
+ ##
41
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
42
+ class ExecutionStepContextPage < Page
43
+ ##
44
+ # Initialize the ExecutionStepContextPage
45
+ # @param [Version] version Version that contains the resource
46
+ # @param [Response] response Response from the API
47
+ # @param [Hash] solution Path solution for the resource
48
+ # @return [ExecutionStepContextPage] ExecutionStepContextPage
49
+ def initialize(version, response, solution)
50
+ super(version, response)
51
+
52
+ # Path Solution
53
+ @solution = solution
54
+ end
55
+
56
+ ##
57
+ # Build an instance of ExecutionStepContextInstance
58
+ # @param [Hash] payload Payload response from the API
59
+ # @return [ExecutionStepContextInstance] ExecutionStepContextInstance
60
+ def get_instance(payload)
61
+ ExecutionStepContextInstance.new(
62
+ @version,
63
+ payload,
64
+ flow_sid: @solution[:flow_sid],
65
+ execution_sid: @solution[:execution_sid],
66
+ step_sid: @solution[:step_sid],
67
+ )
68
+ end
69
+
70
+ ##
71
+ # Provide a user friendly representation
72
+ def to_s
73
+ '<Twilio.Studio.V2.ExecutionStepContextPage>'
74
+ end
75
+ end
76
+
77
+ ##
78
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
79
+ class ExecutionStepContextContext < InstanceContext
80
+ ##
81
+ # Initialize the ExecutionStepContextContext
82
+ # @param [Version] version Version that contains the resource
83
+ # @param [String] flow_sid The flow_sid
84
+ # @param [String] execution_sid The execution_sid
85
+ # @param [String] step_sid The step_sid
86
+ # @return [ExecutionStepContextContext] ExecutionStepContextContext
87
+ def initialize(version, flow_sid, execution_sid, step_sid)
88
+ super(version)
89
+
90
+ # Path Solution
91
+ @solution = {flow_sid: flow_sid, execution_sid: execution_sid, step_sid: step_sid, }
92
+ @uri = "/Flows/#{@solution[:flow_sid]}/Executions/#{@solution[:execution_sid]}/Steps/#{@solution[:step_sid]}/Context"
93
+ end
94
+
95
+ ##
96
+ # Fetch a ExecutionStepContextInstance
97
+ # @return [ExecutionStepContextInstance] Fetched ExecutionStepContextInstance
98
+ def fetch
99
+ params = Twilio::Values.of({})
100
+
101
+ payload = @version.fetch(
102
+ 'GET',
103
+ @uri,
104
+ params,
105
+ )
106
+
107
+ ExecutionStepContextInstance.new(
108
+ @version,
109
+ payload,
110
+ flow_sid: @solution[:flow_sid],
111
+ execution_sid: @solution[:execution_sid],
112
+ step_sid: @solution[:step_sid],
113
+ )
114
+ end
115
+
116
+ ##
117
+ # Provide a user friendly representation
118
+ def to_s
119
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
120
+ "#<Twilio.Studio.V2.ExecutionStepContextContext #{context}>"
121
+ end
122
+
123
+ ##
124
+ # Provide a detailed, user friendly representation
125
+ def inspect
126
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
127
+ "#<Twilio.Studio.V2.ExecutionStepContextContext #{context}>"
128
+ end
129
+ end
130
+
131
+ ##
132
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
133
+ class ExecutionStepContextInstance < InstanceResource
134
+ ##
135
+ # Initialize the ExecutionStepContextInstance
136
+ # @param [Version] version Version that contains the resource
137
+ # @param [Hash] payload payload that contains response from Twilio
138
+ # @param [String] flow_sid The flow_sid
139
+ # @param [String] execution_sid The execution_sid
140
+ # @param [String] step_sid The step_sid
141
+ # @return [ExecutionStepContextInstance] ExecutionStepContextInstance
142
+ def initialize(version, payload, flow_sid: nil, execution_sid: nil, step_sid: nil)
143
+ super(version)
144
+
145
+ # Marshaled Properties
146
+ @properties = {
147
+ 'account_sid' => payload['account_sid'],
148
+ 'context' => payload['context'],
149
+ 'execution_sid' => payload['execution_sid'],
150
+ 'flow_sid' => payload['flow_sid'],
151
+ 'step_sid' => payload['step_sid'],
152
+ 'url' => payload['url'],
153
+ }
154
+
155
+ # Context
156
+ @instance_context = nil
157
+ @params = {'flow_sid' => flow_sid, 'execution_sid' => execution_sid, 'step_sid' => step_sid, }
158
+ end
159
+
160
+ ##
161
+ # Generate an instance context for the instance, the context is capable of
162
+ # performing various actions. All instance actions are proxied to the context
163
+ # @return [ExecutionStepContextContext] ExecutionStepContextContext for this ExecutionStepContextInstance
164
+ def context
165
+ unless @instance_context
166
+ @instance_context = ExecutionStepContextContext.new(
167
+ @version,
168
+ @params['flow_sid'],
169
+ @params['execution_sid'],
170
+ @params['step_sid'],
171
+ )
172
+ end
173
+ @instance_context
174
+ end
175
+
176
+ ##
177
+ # @return [String] The account_sid
178
+ def account_sid
179
+ @properties['account_sid']
180
+ end
181
+
182
+ ##
183
+ # @return [Hash] The context
184
+ def context
185
+ @properties['context']
186
+ end
187
+
188
+ ##
189
+ # @return [String] The execution_sid
190
+ def execution_sid
191
+ @properties['execution_sid']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The flow_sid
196
+ def flow_sid
197
+ @properties['flow_sid']
198
+ end
199
+
200
+ ##
201
+ # @return [String] The step_sid
202
+ def step_sid
203
+ @properties['step_sid']
204
+ end
205
+
206
+ ##
207
+ # @return [String] The url
208
+ def url
209
+ @properties['url']
210
+ end
211
+
212
+ ##
213
+ # Fetch a ExecutionStepContextInstance
214
+ # @return [ExecutionStepContextInstance] Fetched ExecutionStepContextInstance
215
+ def fetch
216
+ context.fetch
217
+ end
218
+
219
+ ##
220
+ # Provide a user friendly representation
221
+ def to_s
222
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
223
+ "<Twilio.Studio.V2.ExecutionStepContextInstance #{values}>"
224
+ end
225
+
226
+ ##
227
+ # Provide a detailed, user friendly representation
228
+ def inspect
229
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
230
+ "<Twilio.Studio.V2.ExecutionStepContextInstance #{values}>"
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
236
+ end
237
+ end
238
+ end
239
+ end
@@ -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 Studio < Domain
12
+ class V2 < Version
13
+ class FlowContext < InstanceContext
14
+ ##
15
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
+ class FlowTestUserList < ListResource
17
+ ##
18
+ # Initialize the FlowTestUserList
19
+ # @param [Version] version Version that contains the resource
20
+ # @param [String] sid The sid
21
+ # @return [FlowTestUserList] FlowTestUserList
22
+ def initialize(version, sid: nil)
23
+ super(version)
24
+
25
+ # Path Solution
26
+ @solution = {sid: sid}
27
+ end
28
+
29
+ ##
30
+ # Provide a user friendly representation
31
+ def to_s
32
+ '#<Twilio.Studio.V2.FlowTestUserList>'
33
+ end
34
+ end
35
+
36
+ ##
37
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
38
+ class FlowTestUserPage < Page
39
+ ##
40
+ # Initialize the FlowTestUserPage
41
+ # @param [Version] version Version that contains the resource
42
+ # @param [Response] response Response from the API
43
+ # @param [Hash] solution Path solution for the resource
44
+ # @return [FlowTestUserPage] FlowTestUserPage
45
+ def initialize(version, response, solution)
46
+ super(version, response)
47
+
48
+ # Path Solution
49
+ @solution = solution
50
+ end
51
+
52
+ ##
53
+ # Build an instance of FlowTestUserInstance
54
+ # @param [Hash] payload Payload response from the API
55
+ # @return [FlowTestUserInstance] FlowTestUserInstance
56
+ def get_instance(payload)
57
+ FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], )
58
+ end
59
+
60
+ ##
61
+ # Provide a user friendly representation
62
+ def to_s
63
+ '<Twilio.Studio.V2.FlowTestUserPage>'
64
+ end
65
+ end
66
+
67
+ ##
68
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
69
+ class FlowTestUserContext < InstanceContext
70
+ ##
71
+ # Initialize the FlowTestUserContext
72
+ # @param [Version] version Version that contains the resource
73
+ # @param [String] sid The sid
74
+ # @return [FlowTestUserContext] FlowTestUserContext
75
+ def initialize(version, sid)
76
+ super(version)
77
+
78
+ # Path Solution
79
+ @solution = {sid: sid, }
80
+ @uri = "/Flows/#{@solution[:sid]}/TestUsers"
81
+ end
82
+
83
+ ##
84
+ # Fetch a FlowTestUserInstance
85
+ # @return [FlowTestUserInstance] Fetched FlowTestUserInstance
86
+ def fetch
87
+ params = Twilio::Values.of({})
88
+
89
+ payload = @version.fetch(
90
+ 'GET',
91
+ @uri,
92
+ params,
93
+ )
94
+
95
+ FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], )
96
+ end
97
+
98
+ ##
99
+ # Update the FlowTestUserInstance
100
+ # @param [String] test_users The test_users
101
+ # @return [FlowTestUserInstance] Updated FlowTestUserInstance
102
+ def update(test_users: nil)
103
+ data = Twilio::Values.of({'TestUsers' => Twilio.serialize_list(test_users) { |e| e }, })
104
+
105
+ payload = @version.update(
106
+ 'POST',
107
+ @uri,
108
+ data: data,
109
+ )
110
+
111
+ FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], )
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.Studio.V2.FlowTestUserContext #{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.Studio.V2.FlowTestUserContext #{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 FlowTestUserInstance < InstanceResource
132
+ ##
133
+ # Initialize the FlowTestUserInstance
134
+ # @param [Version] version Version that contains the resource
135
+ # @param [Hash] payload payload that contains response from Twilio
136
+ # @param [String] sid The sid
137
+ # @return [FlowTestUserInstance] FlowTestUserInstance
138
+ def initialize(version, payload, sid: nil)
139
+ super(version)
140
+
141
+ # Marshaled Properties
142
+ @properties = {
143
+ 'sid' => payload['sid'],
144
+ 'test_users' => payload['test_users'],
145
+ 'url' => payload['url'],
146
+ }
147
+
148
+ # Context
149
+ @instance_context = nil
150
+ @params = {'sid' => sid, }
151
+ end
152
+
153
+ ##
154
+ # Generate an instance context for the instance, the context is capable of
155
+ # performing various actions. All instance actions are proxied to the context
156
+ # @return [FlowTestUserContext] FlowTestUserContext for this FlowTestUserInstance
157
+ def context
158
+ unless @instance_context
159
+ @instance_context = FlowTestUserContext.new(@version, @params['sid'], )
160
+ end
161
+ @instance_context
162
+ end
163
+
164
+ ##
165
+ # @return [String] The sid
166
+ def sid
167
+ @properties['sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The test_users
172
+ def test_users
173
+ @properties['test_users']
174
+ end
175
+
176
+ ##
177
+ # @return [String] The url
178
+ def url
179
+ @properties['url']
180
+ end
181
+
182
+ ##
183
+ # Fetch a FlowTestUserInstance
184
+ # @return [FlowTestUserInstance] Fetched FlowTestUserInstance
185
+ def fetch
186
+ context.fetch
187
+ end
188
+
189
+ ##
190
+ # Update the FlowTestUserInstance
191
+ # @param [String] test_users The test_users
192
+ # @return [FlowTestUserInstance] Updated FlowTestUserInstance
193
+ def update(test_users: nil)
194
+ context.update(test_users: test_users, )
195
+ end
196
+
197
+ ##
198
+ # Provide a user friendly representation
199
+ def to_s
200
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
201
+ "<Twilio.Studio.V2.FlowTestUserInstance #{values}>"
202
+ end
203
+
204
+ ##
205
+ # Provide a detailed, user friendly representation
206
+ def inspect
207
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
208
+ "<Twilio.Studio.V2.FlowTestUserInstance #{values}>"
209
+ end
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end