twilio-ruby 5.3.0 → 5.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/CHANGES.md +9 -0
  4. data/README.md +2 -11
  5. data/lib/twilio-ruby.rb +17 -0
  6. data/lib/twilio-ruby/rest/client.rb +3 -3
  7. data/lib/twilio-ruby/rest/preview.rb +7 -0
  8. data/lib/twilio-ruby/rest/preview/acc_security.rb +41 -0
  9. data/lib/twilio-ruby/rest/preview/acc_security/service.rb +429 -0
  10. data/lib/twilio-ruby/rest/preview/acc_security/service/verification.rb +197 -0
  11. data/lib/twilio-ruby/rest/preview/acc_security/service/verification_check.rb +193 -0
  12. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +14 -14
  13. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +35 -44
  14. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +1 -1
  15. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +14 -14
  16. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +14 -14
  17. data/lib/twilio-ruby/util.rb +2 -0
  18. data/lib/twilio-ruby/util/configuration.rb +17 -0
  19. data/lib/twilio-ruby/version.rb +1 -1
  20. data/spec/integration/preview/acc_security/service/verification_check_spec.rb +52 -0
  21. data/spec/integration/preview/acc_security/service/verification_spec.rb +53 -0
  22. data/spec/integration/preview/acc_security/service_spec.rb +185 -0
  23. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +2 -2
  24. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +2 -2
  25. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +2 -2
  26. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +6 -6
  27. data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +12 -16
  28. data/spec/integration/taskrouter/v1/workspace/worker/workers_cumulative_statistics_spec.rb +2 -2
  29. data/spec/integration/taskrouter/v1/workspace/worker/workers_real_time_statistics_spec.rb +2 -2
  30. data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +12 -8
  31. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics_spec.rb +2 -2
  32. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_real_time_statistics_spec.rb +2 -2
  33. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +8 -8
  34. data/spec/integration/taskrouter/v1/workspace/workspace_cumulative_statistics_spec.rb +2 -2
  35. data/spec/integration/taskrouter/v1/workspace/workspace_real_time_statistics_spec.rb +2 -2
  36. data/spec/integration/taskrouter/v1/workspace_spec.rb +8 -8
  37. data/spec/twilio_spec.rb +15 -0
  38. data/spec/util/configuration_spec.rb +15 -0
  39. metadata +16 -3
@@ -0,0 +1,197 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class AccSecurity < Version
11
+ class ServiceContext < InstanceContext
12
+ ##
13
+ # 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.
14
+ class VerificationList < ListResource
15
+ ##
16
+ # Initialize the VerificationList
17
+ # @param [Version] version Version that contains the resource
18
+ # @param [String] service_sid The unique SID identifier of the Service.
19
+ # @return [VerificationList] VerificationList
20
+ def initialize(version, service_sid: nil)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {
25
+ service_sid: service_sid
26
+ }
27
+ @uri = "/Services/#{@solution[:service_sid]}/Verifications"
28
+ end
29
+
30
+ ##
31
+ # Retrieve a single page of VerificationInstance records from the API.
32
+ # Request is executed immediately.
33
+ # @param [String] to The To phonenumber of the phone being verified
34
+ # @param [String] channel The method in which the phone will be verified. Either
35
+ # sms or call
36
+ # @param [String] custom_message A character string containing a custom message
37
+ # for this verification
38
+ # @return [VerificationInstance] Newly created VerificationInstance
39
+ def create(to: nil, channel: nil, custom_message: :unset)
40
+ data = Twilio::Values.of({
41
+ 'To' => to,
42
+ 'Channel' => channel,
43
+ 'CustomMessage' => custom_message,
44
+ })
45
+
46
+ payload = @version.create(
47
+ 'POST',
48
+ @uri,
49
+ data: data
50
+ )
51
+
52
+ VerificationInstance.new(
53
+ @version,
54
+ payload,
55
+ service_sid: @solution[:service_sid],
56
+ )
57
+ end
58
+
59
+ ##
60
+ # Provide a user friendly representation
61
+ def to_s
62
+ '#<Twilio.Preview.AccSecurity.VerificationList>'
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 VerificationPage < Page
69
+ ##
70
+ # Initialize the VerificationPage
71
+ # @param [Version] version Version that contains the resource
72
+ # @param [Response] response Response from the API
73
+ # @param [Hash] solution Path solution for the resource
74
+ # @return [VerificationPage] VerificationPage
75
+ def initialize(version, response, solution)
76
+ super(version, response)
77
+
78
+ # Path Solution
79
+ @solution = solution
80
+ end
81
+
82
+ ##
83
+ # Build an instance of VerificationInstance
84
+ # @param [Hash] payload Payload response from the API
85
+ # @return [VerificationInstance] VerificationInstance
86
+ def get_instance(payload)
87
+ VerificationInstance.new(
88
+ @version,
89
+ payload,
90
+ service_sid: @solution[:service_sid],
91
+ )
92
+ end
93
+
94
+ ##
95
+ # Provide a user friendly representation
96
+ def to_s
97
+ '<Twilio.Preview.AccSecurity.VerificationPage>'
98
+ end
99
+ end
100
+
101
+ ##
102
+ # 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.
103
+ class VerificationInstance < InstanceResource
104
+ ##
105
+ # Initialize the VerificationInstance
106
+ # @param [Version] version Version that contains the resource
107
+ # @param [Hash] payload payload that contains response from Twilio
108
+ # @param [String] service_sid The unique SID identifier of the Service.
109
+ # @return [VerificationInstance] VerificationInstance
110
+ def initialize(version, payload, service_sid: nil)
111
+ super(version)
112
+
113
+ # Marshaled Properties
114
+ @properties = {
115
+ 'sid' => payload['sid'],
116
+ 'service_sid' => payload['service_sid'],
117
+ 'account_sid' => payload['account_sid'],
118
+ 'to' => payload['to'],
119
+ 'channel' => payload['channel'],
120
+ 'status' => payload['status'],
121
+ 'valid' => payload['valid'],
122
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
123
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
124
+ }
125
+ end
126
+
127
+ ##
128
+ # @return [String] A string that uniquely identifies this Verification.
129
+ def sid
130
+ @properties['sid']
131
+ end
132
+
133
+ ##
134
+ # @return [String] Service Sid.
135
+ def service_sid
136
+ @properties['service_sid']
137
+ end
138
+
139
+ ##
140
+ # @return [String] Account Sid.
141
+ def account_sid
142
+ @properties['account_sid']
143
+ end
144
+
145
+ ##
146
+ # @return [String] To phonenumber
147
+ def to
148
+ @properties['to']
149
+ end
150
+
151
+ ##
152
+ # @return [verification.Channel] sms or call
153
+ def channel
154
+ @properties['channel']
155
+ end
156
+
157
+ ##
158
+ # @return [String] pending, approved, denied or expired
159
+ def status
160
+ @properties['status']
161
+ end
162
+
163
+ ##
164
+ # @return [Boolean] successful verification
165
+ def valid
166
+ @properties['valid']
167
+ end
168
+
169
+ ##
170
+ # @return [Time] The date this Verification was created
171
+ def date_created
172
+ @properties['date_created']
173
+ end
174
+
175
+ ##
176
+ # @return [Time] The date this Verification was updated
177
+ def date_updated
178
+ @properties['date_updated']
179
+ end
180
+
181
+ ##
182
+ # Provide a user friendly representation
183
+ def to_s
184
+ "<Twilio.Preview.AccSecurity.VerificationInstance>"
185
+ end
186
+
187
+ ##
188
+ # Provide a detailed, user friendly representation
189
+ def inspect
190
+ "<Twilio.Preview.AccSecurity.VerificationInstance>"
191
+ end
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
@@ -0,0 +1,193 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class AccSecurity < Version
11
+ class ServiceContext < InstanceContext
12
+ ##
13
+ # 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.
14
+ class VerificationCheckList < ListResource
15
+ ##
16
+ # Initialize the VerificationCheckList
17
+ # @param [Version] version Version that contains the resource
18
+ # @param [String] service_sid The unique SID identifier of the Service.
19
+ # @return [VerificationCheckList] VerificationCheckList
20
+ def initialize(version, service_sid: nil)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {
25
+ service_sid: service_sid
26
+ }
27
+ @uri = "/Services/#{@solution[:service_sid]}/VerificationCheck"
28
+ end
29
+
30
+ ##
31
+ # Retrieve a single page of VerificationCheckInstance records from the API.
32
+ # Request is executed immediately.
33
+ # @param [String] code The 4-10 character string being verified
34
+ # @param [String] to The To phonenumber of the phone being verified
35
+ # @return [VerificationCheckInstance] Newly created VerificationCheckInstance
36
+ def create(code: nil, to: :unset)
37
+ data = Twilio::Values.of({
38
+ 'Code' => code,
39
+ 'To' => to,
40
+ })
41
+
42
+ payload = @version.create(
43
+ 'POST',
44
+ @uri,
45
+ data: data
46
+ )
47
+
48
+ VerificationCheckInstance.new(
49
+ @version,
50
+ payload,
51
+ service_sid: @solution[:service_sid],
52
+ )
53
+ end
54
+
55
+ ##
56
+ # Provide a user friendly representation
57
+ def to_s
58
+ '#<Twilio.Preview.AccSecurity.VerificationCheckList>'
59
+ end
60
+ end
61
+
62
+ ##
63
+ # 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.
64
+ class VerificationCheckPage < Page
65
+ ##
66
+ # Initialize the VerificationCheckPage
67
+ # @param [Version] version Version that contains the resource
68
+ # @param [Response] response Response from the API
69
+ # @param [Hash] solution Path solution for the resource
70
+ # @return [VerificationCheckPage] VerificationCheckPage
71
+ def initialize(version, response, solution)
72
+ super(version, response)
73
+
74
+ # Path Solution
75
+ @solution = solution
76
+ end
77
+
78
+ ##
79
+ # Build an instance of VerificationCheckInstance
80
+ # @param [Hash] payload Payload response from the API
81
+ # @return [VerificationCheckInstance] VerificationCheckInstance
82
+ def get_instance(payload)
83
+ VerificationCheckInstance.new(
84
+ @version,
85
+ payload,
86
+ service_sid: @solution[:service_sid],
87
+ )
88
+ end
89
+
90
+ ##
91
+ # Provide a user friendly representation
92
+ def to_s
93
+ '<Twilio.Preview.AccSecurity.VerificationCheckPage>'
94
+ end
95
+ end
96
+
97
+ ##
98
+ # 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.
99
+ class VerificationCheckInstance < InstanceResource
100
+ ##
101
+ # Initialize the VerificationCheckInstance
102
+ # @param [Version] version Version that contains the resource
103
+ # @param [Hash] payload payload that contains response from Twilio
104
+ # @param [String] service_sid The unique SID identifier of the Service.
105
+ # @return [VerificationCheckInstance] VerificationCheckInstance
106
+ def initialize(version, payload, service_sid: nil)
107
+ super(version)
108
+
109
+ # Marshaled Properties
110
+ @properties = {
111
+ 'sid' => payload['sid'],
112
+ 'service_sid' => payload['service_sid'],
113
+ 'account_sid' => payload['account_sid'],
114
+ 'to' => payload['to'],
115
+ 'channel' => payload['channel'],
116
+ 'status' => payload['status'],
117
+ 'valid' => payload['valid'],
118
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
119
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
120
+ }
121
+ end
122
+
123
+ ##
124
+ # @return [String] A string that uniquely identifies this Verification Check.
125
+ def sid
126
+ @properties['sid']
127
+ end
128
+
129
+ ##
130
+ # @return [String] Service Sid.
131
+ def service_sid
132
+ @properties['service_sid']
133
+ end
134
+
135
+ ##
136
+ # @return [String] Account Sid.
137
+ def account_sid
138
+ @properties['account_sid']
139
+ end
140
+
141
+ ##
142
+ # @return [String] To phonenumber
143
+ def to
144
+ @properties['to']
145
+ end
146
+
147
+ ##
148
+ # @return [verification_check.Channel] sms or call
149
+ def channel
150
+ @properties['channel']
151
+ end
152
+
153
+ ##
154
+ # @return [String] pending, approved, denied or expired
155
+ def status
156
+ @properties['status']
157
+ end
158
+
159
+ ##
160
+ # @return [Boolean] successful verification
161
+ def valid
162
+ @properties['valid']
163
+ end
164
+
165
+ ##
166
+ # @return [Time] The date this Verification Check was created
167
+ def date_created
168
+ @properties['date_created']
169
+ end
170
+
171
+ ##
172
+ # @return [Time] The date this Verification Check was updated
173
+ def date_updated
174
+ @properties['date_updated']
175
+ end
176
+
177
+ ##
178
+ # Provide a user friendly representation
179
+ def to_s
180
+ "<Twilio.Preview.AccSecurity.VerificationCheckInstance>"
181
+ end
182
+
183
+ ##
184
+ # Provide a detailed, user friendly representation
185
+ def inspect
186
+ "<Twilio.Preview.AccSecurity.VerificationCheckInstance>"
187
+ end
188
+ end
189
+ end
190
+ end
191
+ end
192
+ end
193
+ end
@@ -210,8 +210,8 @@ module Twilio
210
210
  @workers = nil
211
211
  @workflows = nil
212
212
  @statistics = nil
213
- @workspace_real_time_statistics = nil
214
- @workspace_cumulative_statistics = nil
213
+ @real_time_statistics = nil
214
+ @cumulative_statistics = nil
215
215
  @task_channels = nil
216
216
  end
217
217
 
@@ -437,10 +437,10 @@ module Twilio
437
437
  end
438
438
 
439
439
  ##
440
- # Access the workspace_real_time_statistics
440
+ # Access the real_time_statistics
441
441
  # @return [WorkspaceRealTimeStatisticsList]
442
442
  # @return [WorkspaceRealTimeStatisticsContext]
443
- def workspace_real_time_statistics
443
+ def real_time_statistics
444
444
  WorkspaceRealTimeStatisticsContext.new(
445
445
  @version,
446
446
  @solution[:sid],
@@ -448,10 +448,10 @@ module Twilio
448
448
  end
449
449
 
450
450
  ##
451
- # Access the workspace_cumulative_statistics
451
+ # Access the cumulative_statistics
452
452
  # @return [WorkspaceCumulativeStatisticsList]
453
453
  # @return [WorkspaceCumulativeStatisticsContext]
454
- def workspace_cumulative_statistics
454
+ def cumulative_statistics
455
455
  WorkspaceCumulativeStatisticsContext.new(
456
456
  @version,
457
457
  @solution[:sid],
@@ -717,17 +717,17 @@ module Twilio
717
717
  end
718
718
 
719
719
  ##
720
- # Access the workspace_real_time_statistics
721
- # @return [workspace_real_time_statistics] workspace_real_time_statistics
722
- def workspace_real_time_statistics
723
- context.workspace_real_time_statistics
720
+ # Access the real_time_statistics
721
+ # @return [real_time_statistics] real_time_statistics
722
+ def real_time_statistics
723
+ context.real_time_statistics
724
724
  end
725
725
 
726
726
  ##
727
- # Access the workspace_cumulative_statistics
728
- # @return [workspace_cumulative_statistics] workspace_cumulative_statistics
729
- def workspace_cumulative_statistics
730
- context.workspace_cumulative_statistics
727
+ # Access the cumulative_statistics
728
+ # @return [cumulative_statistics] cumulative_statistics
729
+ def cumulative_statistics
730
+ context.cumulative_statistics
731
731
  end
732
732
 
733
733
  ##