twilio-ruby 5.31.2 → 5.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +31 -0
- data/CODE_OF_CONDUCT.md +73 -0
- data/ISSUE_TEMPLATE.md +13 -13
- data/LICENSE.md +1 -1
- data/PULL_REQUEST_TEMPLATE.md +31 -0
- data/README.md +3 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +35 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +0 -14
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +359 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +12 -6
- data/lib/twilio-ruby/rest/preview.rb +2 -9
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +2 -2
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +5 -5
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -5
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +21 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +21 -13
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +5 -5
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service.rb +19 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +4 -1
- data/lib/twilio-ruby/twiml/voice_response.rb +9 -6
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/notification_spec.rb +8 -44
- data/spec/integration/api/v2010/account/call/payment_spec.rb +135 -0
- data/spec/integration/api/v2010/account/call_spec.rb +20 -10
- data/spec/integration/preview/bulk_exports/export/job_spec.rb +3 -0
- data/spec/integration/studio/v2/flow_spec.rb +7 -3
- data/spec/integration/studio/v2/flow_validate_spec.rb +7 -3
- data/spec/integration/verify/v2/service/verification_check_spec.rb +26 -0
- data/spec/integration/verify/v2/service_spec.rb +4 -0
- metadata +7 -12
- data/lib/twilio-ruby/rest/preview/acc_security.rb +0 -43
- data/lib/twilio-ruby/rest/preview/acc_security/service.rb +0 -395
- data/lib/twilio-ruby/rest/preview/acc_security/service/verification.rb +0 -185
- data/lib/twilio-ruby/rest/preview/acc_security/service/verification_check.rb +0 -182
- data/spec/integration/preview/acc_security/service/verification_check_spec.rb +0 -52
- data/spec/integration/preview/acc_security/service/verification_spec.rb +0 -52
- data/spec/integration/preview/acc_security/service_spec.rb +0 -185
@@ -40,6 +40,7 @@ describe 'Service' do
|
|
40
40
|
"dtmf_input_required": false,
|
41
41
|
"tts_name": "name",
|
42
42
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
43
|
+
"do_not_share_warning_enabled": false,
|
43
44
|
"date_created": "2015-07-30T20:00:00Z",
|
44
45
|
"date_updated": "2015-07-30T20:00:00Z",
|
45
46
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -88,6 +89,7 @@ describe 'Service' do
|
|
88
89
|
"dtmf_input_required": false,
|
89
90
|
"tts_name": "name",
|
90
91
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
92
|
+
"do_not_share_warning_enabled": false,
|
91
93
|
"date_created": "2015-07-30T20:00:00Z",
|
92
94
|
"date_updated": "2015-07-30T20:00:00Z",
|
93
95
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -173,6 +175,7 @@ describe 'Service' do
|
|
173
175
|
"dtmf_input_required": false,
|
174
176
|
"tts_name": "name",
|
175
177
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
178
|
+
"do_not_share_warning_enabled": false,
|
176
179
|
"date_created": "2015-07-30T20:00:00Z",
|
177
180
|
"date_updated": "2015-07-30T20:00:00Z",
|
178
181
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -223,6 +226,7 @@ describe 'Service' do
|
|
223
226
|
"dtmf_input_required": false,
|
224
227
|
"tts_name": "name",
|
225
228
|
"mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
229
|
+
"do_not_share_warning_enabled": false,
|
226
230
|
"date_created": "2015-07-30T20:00:00Z",
|
227
231
|
"date_updated": "2015-07-30T20:00:00Z",
|
228
232
|
"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.31.
|
4
|
+
version: 5.31.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -128,12 +128,14 @@ files:
|
|
128
128
|
- ".travis.yml"
|
129
129
|
- AUTHORS.md
|
130
130
|
- CHANGES.md
|
131
|
+
- CODE_OF_CONDUCT.md
|
131
132
|
- CONTRIBUTING.md
|
132
133
|
- Dockerfile
|
133
134
|
- Gemfile
|
134
135
|
- ISSUE_TEMPLATE.md
|
135
136
|
- LICENSE.md
|
136
137
|
- Makefile
|
138
|
+
- PULL_REQUEST_TEMPLATE.md
|
137
139
|
- README.md
|
138
140
|
- Rakefile
|
139
141
|
- UPGRADE.md
|
@@ -186,6 +188,7 @@ files:
|
|
186
188
|
- lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb
|
187
189
|
- lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb
|
188
190
|
- lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
|
191
|
+
- lib/twilio-ruby/rest/api/v2010/account/call/payment.rb
|
189
192
|
- lib/twilio-ruby/rest/api/v2010/account/call/recording.rb
|
190
193
|
- lib/twilio-ruby/rest/api/v2010/account/conference.rb
|
191
194
|
- lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
|
@@ -371,10 +374,6 @@ files:
|
|
371
374
|
- lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb
|
372
375
|
- lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb
|
373
376
|
- lib/twilio-ruby/rest/preview.rb
|
374
|
-
- lib/twilio-ruby/rest/preview/acc_security.rb
|
375
|
-
- lib/twilio-ruby/rest/preview/acc_security/service.rb
|
376
|
-
- lib/twilio-ruby/rest/preview/acc_security/service/verification.rb
|
377
|
-
- lib/twilio-ruby/rest/preview/acc_security/service/verification_check.rb
|
378
377
|
- lib/twilio-ruby/rest/preview/bulk_exports.rb
|
379
378
|
- lib/twilio-ruby/rest/preview/bulk_exports/export.rb
|
380
379
|
- lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb
|
@@ -600,6 +599,7 @@ files:
|
|
600
599
|
- spec/integration/api/v2010/account/call/feedback_spec.rb
|
601
600
|
- spec/integration/api/v2010/account/call/feedback_summary_spec.rb
|
602
601
|
- spec/integration/api/v2010/account/call/notification_spec.rb
|
602
|
+
- spec/integration/api/v2010/account/call/payment_spec.rb
|
603
603
|
- spec/integration/api/v2010/account/call/recording_spec.rb
|
604
604
|
- spec/integration/api/v2010/account/call_spec.rb
|
605
605
|
- spec/integration/api/v2010/account/conference/participant_spec.rb
|
@@ -757,9 +757,6 @@ files:
|
|
757
757
|
- spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb
|
758
758
|
- spec/integration/numbers/v2/regulatory_compliance/supporting_document_type_spec.rb
|
759
759
|
- spec/integration/numbers/v2/regulatory_compliance_spec.rb
|
760
|
-
- spec/integration/preview/acc_security/service/verification_check_spec.rb
|
761
|
-
- spec/integration/preview/acc_security/service/verification_spec.rb
|
762
|
-
- spec/integration/preview/acc_security/service_spec.rb
|
763
760
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
764
761
|
- spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb
|
765
762
|
- spec/integration/preview/bulk_exports/export/job_spec.rb
|
@@ -991,6 +988,7 @@ test_files:
|
|
991
988
|
- spec/integration/api/v2010/account/call/feedback_spec.rb
|
992
989
|
- spec/integration/api/v2010/account/call/feedback_summary_spec.rb
|
993
990
|
- spec/integration/api/v2010/account/call/notification_spec.rb
|
991
|
+
- spec/integration/api/v2010/account/call/payment_spec.rb
|
994
992
|
- spec/integration/api/v2010/account/call/recording_spec.rb
|
995
993
|
- spec/integration/api/v2010/account/call_spec.rb
|
996
994
|
- spec/integration/api/v2010/account/conference/participant_spec.rb
|
@@ -1148,9 +1146,6 @@ test_files:
|
|
1148
1146
|
- spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb
|
1149
1147
|
- spec/integration/numbers/v2/regulatory_compliance/supporting_document_type_spec.rb
|
1150
1148
|
- spec/integration/numbers/v2/regulatory_compliance_spec.rb
|
1151
|
-
- spec/integration/preview/acc_security/service/verification_check_spec.rb
|
1152
|
-
- spec/integration/preview/acc_security/service/verification_spec.rb
|
1153
|
-
- spec/integration/preview/acc_security/service_spec.rb
|
1154
1149
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
1155
1150
|
- spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb
|
1156
1151
|
- spec/integration/preview/bulk_exports/export/job_spec.rb
|
@@ -1,43 +0,0 @@
|
|
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
|
12
|
-
class AccSecurity < Version
|
13
|
-
##
|
14
|
-
# Initialize the AccSecurity version of Preview
|
15
|
-
def initialize(domain)
|
16
|
-
super
|
17
|
-
@version = 'Verification'
|
18
|
-
@services = nil
|
19
|
-
end
|
20
|
-
|
21
|
-
##
|
22
|
-
# @param [String] sid The unique SID identifier of Verification Service Instance.
|
23
|
-
# @return [Twilio::REST::Preview::AccSecurity::ServiceContext] if sid was passed.
|
24
|
-
# @return [Twilio::REST::Preview::AccSecurity::ServiceList]
|
25
|
-
def services(sid=:unset)
|
26
|
-
if sid.nil?
|
27
|
-
raise ArgumentError, 'sid cannot be nil'
|
28
|
-
elsif sid == :unset
|
29
|
-
@services ||= ServiceList.new self
|
30
|
-
else
|
31
|
-
ServiceContext.new(self, sid)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
##
|
36
|
-
# Provide a user friendly representation
|
37
|
-
def to_s
|
38
|
-
'<Twilio::REST::Preview::AccSecurity>'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,395 +0,0 @@
|
|
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 AccSecurity < Version
|
13
|
-
##
|
14
|
-
# 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.
|
15
|
-
class ServiceList < ListResource
|
16
|
-
##
|
17
|
-
# Initialize the ServiceList
|
18
|
-
# @param [Version] version Version that contains the resource
|
19
|
-
# @return [ServiceList] ServiceList
|
20
|
-
def initialize(version)
|
21
|
-
super(version)
|
22
|
-
|
23
|
-
# Path Solution
|
24
|
-
@solution = {}
|
25
|
-
@uri = "/Services"
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
30
|
-
# Request is executed immediately.
|
31
|
-
# @param [String] name A 1-64 character string with friendly name of service
|
32
|
-
# @param [String] code_length The length of the verification code to be generated.
|
33
|
-
# Must be an integer value between 4-10
|
34
|
-
# @return [ServiceInstance] Newly created ServiceInstance
|
35
|
-
def create(name: nil, code_length: :unset)
|
36
|
-
data = Twilio::Values.of({'Name' => name, 'CodeLength' => code_length, })
|
37
|
-
|
38
|
-
payload = @version.create(
|
39
|
-
'POST',
|
40
|
-
@uri,
|
41
|
-
data: data
|
42
|
-
)
|
43
|
-
|
44
|
-
ServiceInstance.new(@version, payload, )
|
45
|
-
end
|
46
|
-
|
47
|
-
##
|
48
|
-
# Lists ServiceInstance records from the API as a list.
|
49
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
50
|
-
# memory before returning.
|
51
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
52
|
-
# guarantees to never return more than limit. Default is no limit
|
53
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
54
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
55
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
56
|
-
# efficient page size, i.e. min(limit, 1000)
|
57
|
-
# @return [Array] Array of up to limit results
|
58
|
-
def list(limit: nil, page_size: nil)
|
59
|
-
self.stream(limit: limit, page_size: page_size).entries
|
60
|
-
end
|
61
|
-
|
62
|
-
##
|
63
|
-
# Streams ServiceInstance records from the API as an Enumerable.
|
64
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
-
# is reached.
|
66
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
67
|
-
# guarantees to never return more than limit. Default is no limit.
|
68
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
69
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
70
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
71
|
-
# efficient page size, i.e. min(limit, 1000)
|
72
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
73
|
-
def stream(limit: nil, page_size: nil)
|
74
|
-
limits = @version.read_limits(limit, page_size)
|
75
|
-
|
76
|
-
page = self.page(page_size: limits[:page_size], )
|
77
|
-
|
78
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
79
|
-
end
|
80
|
-
|
81
|
-
##
|
82
|
-
# When passed a block, yields ServiceInstance records from the API.
|
83
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
84
|
-
# is reached.
|
85
|
-
def each
|
86
|
-
limits = @version.read_limits
|
87
|
-
|
88
|
-
page = self.page(page_size: limits[:page_size], )
|
89
|
-
|
90
|
-
@version.stream(page,
|
91
|
-
limit: limits[:limit],
|
92
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
97
|
-
# Request is executed immediately.
|
98
|
-
# @param [String] page_token PageToken provided by the API
|
99
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
100
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
101
|
-
# @return [Page] Page of ServiceInstance
|
102
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
103
|
-
params = Twilio::Values.of({
|
104
|
-
'PageToken' => page_token,
|
105
|
-
'Page' => page_number,
|
106
|
-
'PageSize' => page_size,
|
107
|
-
})
|
108
|
-
response = @version.page(
|
109
|
-
'GET',
|
110
|
-
@uri,
|
111
|
-
params
|
112
|
-
)
|
113
|
-
ServicePage.new(@version, response, @solution)
|
114
|
-
end
|
115
|
-
|
116
|
-
##
|
117
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
118
|
-
# Request is executed immediately.
|
119
|
-
# @param [String] target_url API-generated URL for the requested results page
|
120
|
-
# @return [Page] Page of ServiceInstance
|
121
|
-
def get_page(target_url)
|
122
|
-
response = @version.domain.request(
|
123
|
-
'GET',
|
124
|
-
target_url
|
125
|
-
)
|
126
|
-
ServicePage.new(@version, response, @solution)
|
127
|
-
end
|
128
|
-
|
129
|
-
##
|
130
|
-
# Provide a user friendly representation
|
131
|
-
def to_s
|
132
|
-
'#<Twilio.Preview.AccSecurity.ServiceList>'
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
##
|
137
|
-
# 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.
|
138
|
-
class ServicePage < Page
|
139
|
-
##
|
140
|
-
# Initialize the ServicePage
|
141
|
-
# @param [Version] version Version that contains the resource
|
142
|
-
# @param [Response] response Response from the API
|
143
|
-
# @param [Hash] solution Path solution for the resource
|
144
|
-
# @return [ServicePage] ServicePage
|
145
|
-
def initialize(version, response, solution)
|
146
|
-
super(version, response)
|
147
|
-
|
148
|
-
# Path Solution
|
149
|
-
@solution = solution
|
150
|
-
end
|
151
|
-
|
152
|
-
##
|
153
|
-
# Build an instance of ServiceInstance
|
154
|
-
# @param [Hash] payload Payload response from the API
|
155
|
-
# @return [ServiceInstance] ServiceInstance
|
156
|
-
def get_instance(payload)
|
157
|
-
ServiceInstance.new(@version, payload, )
|
158
|
-
end
|
159
|
-
|
160
|
-
##
|
161
|
-
# Provide a user friendly representation
|
162
|
-
def to_s
|
163
|
-
'<Twilio.Preview.AccSecurity.ServicePage>'
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
##
|
168
|
-
# 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.
|
169
|
-
class ServiceContext < InstanceContext
|
170
|
-
##
|
171
|
-
# Initialize the ServiceContext
|
172
|
-
# @param [Version] version Version that contains the resource
|
173
|
-
# @param [String] sid The unique SID identifier of Verification Service Instance.
|
174
|
-
# @return [ServiceContext] ServiceContext
|
175
|
-
def initialize(version, sid)
|
176
|
-
super(version)
|
177
|
-
|
178
|
-
# Path Solution
|
179
|
-
@solution = {sid: sid, }
|
180
|
-
@uri = "/Services/#{@solution[:sid]}"
|
181
|
-
|
182
|
-
# Dependents
|
183
|
-
@verifications = nil
|
184
|
-
@verification_checks = nil
|
185
|
-
end
|
186
|
-
|
187
|
-
##
|
188
|
-
# Fetch a ServiceInstance
|
189
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
190
|
-
def fetch
|
191
|
-
params = Twilio::Values.of({})
|
192
|
-
|
193
|
-
payload = @version.fetch(
|
194
|
-
'GET',
|
195
|
-
@uri,
|
196
|
-
params,
|
197
|
-
)
|
198
|
-
|
199
|
-
ServiceInstance.new(@version, payload, sid: @solution[:sid], )
|
200
|
-
end
|
201
|
-
|
202
|
-
##
|
203
|
-
# Update the ServiceInstance
|
204
|
-
# @param [String] name A 1-64 character string with friendly name of service
|
205
|
-
# @param [String] code_length The length of the verification code to be generated.
|
206
|
-
# Must be an integer value between 4-10
|
207
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
208
|
-
def update(name: :unset, code_length: :unset)
|
209
|
-
data = Twilio::Values.of({'Name' => name, 'CodeLength' => code_length, })
|
210
|
-
|
211
|
-
payload = @version.update(
|
212
|
-
'POST',
|
213
|
-
@uri,
|
214
|
-
data: data,
|
215
|
-
)
|
216
|
-
|
217
|
-
ServiceInstance.new(@version, payload, sid: @solution[:sid], )
|
218
|
-
end
|
219
|
-
|
220
|
-
##
|
221
|
-
# Access the verifications
|
222
|
-
# @return [VerificationList]
|
223
|
-
# @return [VerificationContext]
|
224
|
-
def verifications
|
225
|
-
unless @verifications
|
226
|
-
@verifications = VerificationList.new(@version, service_sid: @solution[:sid], )
|
227
|
-
end
|
228
|
-
|
229
|
-
@verifications
|
230
|
-
end
|
231
|
-
|
232
|
-
##
|
233
|
-
# Access the verification_checks
|
234
|
-
# @return [VerificationCheckList]
|
235
|
-
# @return [VerificationCheckContext]
|
236
|
-
def verification_checks
|
237
|
-
unless @verification_checks
|
238
|
-
@verification_checks = VerificationCheckList.new(@version, service_sid: @solution[:sid], )
|
239
|
-
end
|
240
|
-
|
241
|
-
@verification_checks
|
242
|
-
end
|
243
|
-
|
244
|
-
##
|
245
|
-
# Provide a user friendly representation
|
246
|
-
def to_s
|
247
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
248
|
-
"#<Twilio.Preview.AccSecurity.ServiceContext #{context}>"
|
249
|
-
end
|
250
|
-
|
251
|
-
##
|
252
|
-
# Provide a detailed, user friendly representation
|
253
|
-
def inspect
|
254
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
255
|
-
"#<Twilio.Preview.AccSecurity.ServiceContext #{context}>"
|
256
|
-
end
|
257
|
-
end
|
258
|
-
|
259
|
-
##
|
260
|
-
# 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.
|
261
|
-
class ServiceInstance < InstanceResource
|
262
|
-
##
|
263
|
-
# Initialize the ServiceInstance
|
264
|
-
# @param [Version] version Version that contains the resource
|
265
|
-
# @param [Hash] payload payload that contains response from Twilio
|
266
|
-
# @param [String] sid The unique SID identifier of Verification Service Instance.
|
267
|
-
# @return [ServiceInstance] ServiceInstance
|
268
|
-
def initialize(version, payload, sid: nil)
|
269
|
-
super(version)
|
270
|
-
|
271
|
-
# Marshaled Properties
|
272
|
-
@properties = {
|
273
|
-
'sid' => payload['sid'],
|
274
|
-
'account_sid' => payload['account_sid'],
|
275
|
-
'name' => payload['name'],
|
276
|
-
'code_length' => payload['code_length'].to_i,
|
277
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
278
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
279
|
-
'url' => payload['url'],
|
280
|
-
'links' => payload['links'],
|
281
|
-
}
|
282
|
-
|
283
|
-
# Context
|
284
|
-
@instance_context = nil
|
285
|
-
@params = {'sid' => sid || @properties['sid'], }
|
286
|
-
end
|
287
|
-
|
288
|
-
##
|
289
|
-
# Generate an instance context for the instance, the context is capable of
|
290
|
-
# performing various actions. All instance actions are proxied to the context
|
291
|
-
# @return [ServiceContext] ServiceContext for this ServiceInstance
|
292
|
-
def context
|
293
|
-
unless @instance_context
|
294
|
-
@instance_context = ServiceContext.new(@version, @params['sid'], )
|
295
|
-
end
|
296
|
-
@instance_context
|
297
|
-
end
|
298
|
-
|
299
|
-
##
|
300
|
-
# @return [String] A string that uniquely identifies this Service.
|
301
|
-
def sid
|
302
|
-
@properties['sid']
|
303
|
-
end
|
304
|
-
|
305
|
-
##
|
306
|
-
# @return [String] Account Sid.
|
307
|
-
def account_sid
|
308
|
-
@properties['account_sid']
|
309
|
-
end
|
310
|
-
|
311
|
-
##
|
312
|
-
# @return [String] Friendly name of the service
|
313
|
-
def name
|
314
|
-
@properties['name']
|
315
|
-
end
|
316
|
-
|
317
|
-
##
|
318
|
-
# @return [String] Length of verification code. Valid values are 4-10
|
319
|
-
def code_length
|
320
|
-
@properties['code_length']
|
321
|
-
end
|
322
|
-
|
323
|
-
##
|
324
|
-
# @return [Time] The date this Service was created
|
325
|
-
def date_created
|
326
|
-
@properties['date_created']
|
327
|
-
end
|
328
|
-
|
329
|
-
##
|
330
|
-
# @return [Time] The date this Service was updated
|
331
|
-
def date_updated
|
332
|
-
@properties['date_updated']
|
333
|
-
end
|
334
|
-
|
335
|
-
##
|
336
|
-
# @return [String] The url
|
337
|
-
def url
|
338
|
-
@properties['url']
|
339
|
-
end
|
340
|
-
|
341
|
-
##
|
342
|
-
# @return [String] The links
|
343
|
-
def links
|
344
|
-
@properties['links']
|
345
|
-
end
|
346
|
-
|
347
|
-
##
|
348
|
-
# Fetch a ServiceInstance
|
349
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
350
|
-
def fetch
|
351
|
-
context.fetch
|
352
|
-
end
|
353
|
-
|
354
|
-
##
|
355
|
-
# Update the ServiceInstance
|
356
|
-
# @param [String] name A 1-64 character string with friendly name of service
|
357
|
-
# @param [String] code_length The length of the verification code to be generated.
|
358
|
-
# Must be an integer value between 4-10
|
359
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
360
|
-
def update(name: :unset, code_length: :unset)
|
361
|
-
context.update(name: name, code_length: code_length, )
|
362
|
-
end
|
363
|
-
|
364
|
-
##
|
365
|
-
# Access the verifications
|
366
|
-
# @return [verifications] verifications
|
367
|
-
def verifications
|
368
|
-
context.verifications
|
369
|
-
end
|
370
|
-
|
371
|
-
##
|
372
|
-
# Access the verification_checks
|
373
|
-
# @return [verification_checks] verification_checks
|
374
|
-
def verification_checks
|
375
|
-
context.verification_checks
|
376
|
-
end
|
377
|
-
|
378
|
-
##
|
379
|
-
# Provide a user friendly representation
|
380
|
-
def to_s
|
381
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
382
|
-
"<Twilio.Preview.AccSecurity.ServiceInstance #{values}>"
|
383
|
-
end
|
384
|
-
|
385
|
-
##
|
386
|
-
# Provide a detailed, user friendly representation
|
387
|
-
def inspect
|
388
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
389
|
-
"<Twilio.Preview.AccSecurity.ServiceInstance #{values}>"
|
390
|
-
end
|
391
|
-
end
|
392
|
-
end
|
393
|
-
end
|
394
|
-
end
|
395
|
-
end
|