twilio-ruby 5.16.0 → 5.17.0
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 +5 -5
- data/CHANGES.md +22 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +2 -2
- data/lib/twilio-ruby/rest/authy.rb +9 -9
- data/lib/twilio-ruby/rest/authy/v1.rb +16 -16
- data/lib/twilio-ruby/rest/authy/v1/form.rb +18 -18
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +6 -12
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +6 -13
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +25 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +25 -3
- data/lib/twilio-ruby/rest/preview.rb +13 -20
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +6 -3
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +6 -3
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +4 -1
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/authy/v1/form_spec.rb +1 -1
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +5 -10
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +3 -3
- data/spec/integration/chat/v2/service/channel/member_spec.rb +4 -0
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +4 -0
- metadata +3 -10
- data/lib/twilio-ruby/rest/preview/authy.rb +0 -43
- data/lib/twilio-ruby/rest/preview/authy/service.rb +0 -364
- data/lib/twilio-ruby/rest/preview/authy/service/entity.rb +0 -326
- data/spec/integration/preview/authy/service/entity_spec.rb +0 -173
- data/spec/integration/preview/authy/service_spec.rb +0 -201
@@ -41,6 +41,7 @@ describe 'Member' do
|
|
41
41
|
"last_consumption_timestamp": null,
|
42
42
|
"date_created": "2016-03-24T21:05:50Z",
|
43
43
|
"date_updated": "2016-03-24T21:05:50Z",
|
44
|
+
"attributes": "{}",
|
44
45
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
45
46
|
}
|
46
47
|
]
|
@@ -86,6 +87,7 @@ describe 'Member' do
|
|
86
87
|
"last_consumption_timestamp": null,
|
87
88
|
"date_created": "2016-03-24T21:05:50Z",
|
88
89
|
"date_updated": "2016-03-24T21:05:50Z",
|
90
|
+
"attributes": "{}",
|
89
91
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
90
92
|
}
|
91
93
|
]
|
@@ -141,6 +143,7 @@ describe 'Member' do
|
|
141
143
|
"last_consumption_timestamp": null,
|
142
144
|
"date_created": "2016-03-24T21:05:50Z",
|
143
145
|
"date_updated": "2016-03-24T21:05:50Z",
|
146
|
+
"attributes": "{}",
|
144
147
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
145
148
|
}
|
146
149
|
]
|
@@ -243,6 +246,7 @@ describe 'Member' do
|
|
243
246
|
"last_consumption_timestamp": "2016-03-24T21:05:52Z",
|
244
247
|
"date_created": "2016-03-24T21:05:50Z",
|
245
248
|
"date_updated": "2016-03-24T21:05:51Z",
|
249
|
+
"attributes": "{}",
|
246
250
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
247
251
|
}
|
248
252
|
]
|
@@ -41,6 +41,7 @@ describe 'Member' do
|
|
41
41
|
"last_consumption_timestamp": null,
|
42
42
|
"date_created": "2016-03-24T21:05:50Z",
|
43
43
|
"date_updated": "2016-03-24T21:05:50Z",
|
44
|
+
"attributes": "{}",
|
44
45
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
45
46
|
}
|
46
47
|
]
|
@@ -86,6 +87,7 @@ describe 'Member' do
|
|
86
87
|
"last_consumption_timestamp": null,
|
87
88
|
"date_created": "2016-03-24T21:05:50Z",
|
88
89
|
"date_updated": "2016-03-24T21:05:50Z",
|
90
|
+
"attributes": "{}",
|
89
91
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
90
92
|
}
|
91
93
|
]
|
@@ -141,6 +143,7 @@ describe 'Member' do
|
|
141
143
|
"last_consumption_timestamp": null,
|
142
144
|
"date_created": "2016-03-24T21:05:50Z",
|
143
145
|
"date_updated": "2016-03-24T21:05:50Z",
|
146
|
+
"attributes": "{}",
|
144
147
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
145
148
|
}
|
146
149
|
]
|
@@ -243,6 +246,7 @@ describe 'Member' do
|
|
243
246
|
"last_consumption_timestamp": "2016-03-24T21:05:52Z",
|
244
247
|
"date_created": "2016-03-24T21:05:50Z",
|
245
248
|
"date_updated": "2016-03-24T21:05:51Z",
|
249
|
+
"attributes": "{}",
|
246
250
|
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
247
251
|
}
|
248
252
|
]
|
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.
|
4
|
+
version: 5.17.0
|
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: 2018-11-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -334,9 +334,6 @@ files:
|
|
334
334
|
- lib/twilio-ruby/rest/preview/acc_security/service.rb
|
335
335
|
- lib/twilio-ruby/rest/preview/acc_security/service/verification.rb
|
336
336
|
- lib/twilio-ruby/rest/preview/acc_security/service/verification_check.rb
|
337
|
-
- lib/twilio-ruby/rest/preview/authy.rb
|
338
|
-
- lib/twilio-ruby/rest/preview/authy/service.rb
|
339
|
-
- lib/twilio-ruby/rest/preview/authy/service/entity.rb
|
340
337
|
- lib/twilio-ruby/rest/preview/bulk_exports.rb
|
341
338
|
- lib/twilio-ruby/rest/preview/bulk_exports/export.rb
|
342
339
|
- lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb
|
@@ -661,8 +658,6 @@ files:
|
|
661
658
|
- spec/integration/preview/acc_security/service/verification_check_spec.rb
|
662
659
|
- spec/integration/preview/acc_security/service/verification_spec.rb
|
663
660
|
- spec/integration/preview/acc_security/service_spec.rb
|
664
|
-
- spec/integration/preview/authy/service/entity_spec.rb
|
665
|
-
- spec/integration/preview/authy/service_spec.rb
|
666
661
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
667
662
|
- spec/integration/preview/bulk_exports/export_configuration_spec.rb
|
668
663
|
- spec/integration/preview/bulk_exports/export_spec.rb
|
@@ -835,7 +830,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
835
830
|
version: '0'
|
836
831
|
requirements: []
|
837
832
|
rubyforge_project:
|
838
|
-
rubygems_version: 2.
|
833
|
+
rubygems_version: 2.7.6
|
839
834
|
signing_key:
|
840
835
|
specification_version: 4
|
841
836
|
summary: The official library for communicating with the Twilio REST API, building
|
@@ -998,8 +993,6 @@ test_files:
|
|
998
993
|
- spec/integration/preview/acc_security/service/verification_check_spec.rb
|
999
994
|
- spec/integration/preview/acc_security/service/verification_spec.rb
|
1000
995
|
- spec/integration/preview/acc_security/service_spec.rb
|
1001
|
-
- spec/integration/preview/authy/service/entity_spec.rb
|
1002
|
-
- spec/integration/preview/authy/service_spec.rb
|
1003
996
|
- spec/integration/preview/bulk_exports/export/day_spec.rb
|
1004
997
|
- spec/integration/preview/bulk_exports/export_configuration_spec.rb
|
1005
998
|
- spec/integration/preview/bulk_exports/export_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 Authy < Version
|
13
|
-
##
|
14
|
-
# Initialize the Authy version of Preview
|
15
|
-
def initialize(domain)
|
16
|
-
super
|
17
|
-
@version = 'Authy'
|
18
|
-
@services = nil
|
19
|
-
end
|
20
|
-
|
21
|
-
##
|
22
|
-
# @param [String] sid A 34 character string that uniquely identifies this Service.
|
23
|
-
# @return [Twilio::REST::Preview::Authy::ServiceContext] if sid was passed.
|
24
|
-
# @return [Twilio::REST::Preview::Authy::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::Authy>'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,364 +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 Authy < 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] friendly_name A human readable description of this resource, up
|
32
|
-
# to 64 characters.
|
33
|
-
# @return [ServiceInstance] Newly created ServiceInstance
|
34
|
-
def create(friendly_name: nil)
|
35
|
-
data = Twilio::Values.of({'FriendlyName' => friendly_name, })
|
36
|
-
|
37
|
-
payload = @version.create(
|
38
|
-
'POST',
|
39
|
-
@uri,
|
40
|
-
data: data
|
41
|
-
)
|
42
|
-
|
43
|
-
ServiceInstance.new(@version, payload, )
|
44
|
-
end
|
45
|
-
|
46
|
-
##
|
47
|
-
# Lists ServiceInstance records from the API as a list.
|
48
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
49
|
-
# memory before returning.
|
50
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
51
|
-
# guarantees to never return more than limit. Default is no limit
|
52
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
53
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
54
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
55
|
-
# efficient page size, i.e. min(limit, 1000)
|
56
|
-
# @return [Array] Array of up to limit results
|
57
|
-
def list(limit: nil, page_size: nil)
|
58
|
-
self.stream(limit: limit, page_size: page_size).entries
|
59
|
-
end
|
60
|
-
|
61
|
-
##
|
62
|
-
# Streams ServiceInstance records from the API as an Enumerable.
|
63
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
64
|
-
# is reached.
|
65
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
66
|
-
# guarantees to never return more than limit. Default is no limit.
|
67
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
68
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
69
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
70
|
-
# efficient page size, i.e. min(limit, 1000)
|
71
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
72
|
-
def stream(limit: nil, page_size: nil)
|
73
|
-
limits = @version.read_limits(limit, page_size)
|
74
|
-
|
75
|
-
page = self.page(page_size: limits[:page_size], )
|
76
|
-
|
77
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
78
|
-
end
|
79
|
-
|
80
|
-
##
|
81
|
-
# When passed a block, yields ServiceInstance records from the API.
|
82
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
83
|
-
# is reached.
|
84
|
-
def each
|
85
|
-
limits = @version.read_limits
|
86
|
-
|
87
|
-
page = self.page(page_size: limits[:page_size], )
|
88
|
-
|
89
|
-
@version.stream(page,
|
90
|
-
limit: limits[:limit],
|
91
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
92
|
-
end
|
93
|
-
|
94
|
-
##
|
95
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
96
|
-
# Request is executed immediately.
|
97
|
-
# @param [String] page_token PageToken provided by the API
|
98
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
99
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
100
|
-
# @return [Page] Page of ServiceInstance
|
101
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
102
|
-
params = Twilio::Values.of({
|
103
|
-
'PageToken' => page_token,
|
104
|
-
'Page' => page_number,
|
105
|
-
'PageSize' => page_size,
|
106
|
-
})
|
107
|
-
response = @version.page(
|
108
|
-
'GET',
|
109
|
-
@uri,
|
110
|
-
params
|
111
|
-
)
|
112
|
-
ServicePage.new(@version, response, @solution)
|
113
|
-
end
|
114
|
-
|
115
|
-
##
|
116
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
117
|
-
# Request is executed immediately.
|
118
|
-
# @param [String] target_url API-generated URL for the requested results page
|
119
|
-
# @return [Page] Page of ServiceInstance
|
120
|
-
def get_page(target_url)
|
121
|
-
response = @version.domain.request(
|
122
|
-
'GET',
|
123
|
-
target_url
|
124
|
-
)
|
125
|
-
ServicePage.new(@version, response, @solution)
|
126
|
-
end
|
127
|
-
|
128
|
-
##
|
129
|
-
# Provide a user friendly representation
|
130
|
-
def to_s
|
131
|
-
'#<Twilio.Preview.Authy.ServiceList>'
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
##
|
136
|
-
# 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.
|
137
|
-
class ServicePage < Page
|
138
|
-
##
|
139
|
-
# Initialize the ServicePage
|
140
|
-
# @param [Version] version Version that contains the resource
|
141
|
-
# @param [Response] response Response from the API
|
142
|
-
# @param [Hash] solution Path solution for the resource
|
143
|
-
# @return [ServicePage] ServicePage
|
144
|
-
def initialize(version, response, solution)
|
145
|
-
super(version, response)
|
146
|
-
|
147
|
-
# Path Solution
|
148
|
-
@solution = solution
|
149
|
-
end
|
150
|
-
|
151
|
-
##
|
152
|
-
# Build an instance of ServiceInstance
|
153
|
-
# @param [Hash] payload Payload response from the API
|
154
|
-
# @return [ServiceInstance] ServiceInstance
|
155
|
-
def get_instance(payload)
|
156
|
-
ServiceInstance.new(@version, payload, )
|
157
|
-
end
|
158
|
-
|
159
|
-
##
|
160
|
-
# Provide a user friendly representation
|
161
|
-
def to_s
|
162
|
-
'<Twilio.Preview.Authy.ServicePage>'
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
##
|
167
|
-
# 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.
|
168
|
-
class ServiceContext < InstanceContext
|
169
|
-
##
|
170
|
-
# Initialize the ServiceContext
|
171
|
-
# @param [Version] version Version that contains the resource
|
172
|
-
# @param [String] sid A 34 character string that uniquely identifies this Service.
|
173
|
-
# @return [ServiceContext] ServiceContext
|
174
|
-
def initialize(version, sid)
|
175
|
-
super(version)
|
176
|
-
|
177
|
-
# Path Solution
|
178
|
-
@solution = {sid: sid, }
|
179
|
-
@uri = "/Services/#{@solution[:sid]}"
|
180
|
-
|
181
|
-
# Dependents
|
182
|
-
@entities = nil
|
183
|
-
end
|
184
|
-
|
185
|
-
##
|
186
|
-
# Fetch a ServiceInstance
|
187
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
188
|
-
def fetch
|
189
|
-
params = Twilio::Values.of({})
|
190
|
-
|
191
|
-
payload = @version.fetch(
|
192
|
-
'GET',
|
193
|
-
@uri,
|
194
|
-
params,
|
195
|
-
)
|
196
|
-
|
197
|
-
ServiceInstance.new(@version, payload, sid: @solution[:sid], )
|
198
|
-
end
|
199
|
-
|
200
|
-
##
|
201
|
-
# Update the ServiceInstance
|
202
|
-
# @param [String] friendly_name A human readable description of this resource, up
|
203
|
-
# to 64 characters.
|
204
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
205
|
-
def update(friendly_name: :unset)
|
206
|
-
data = Twilio::Values.of({'FriendlyName' => friendly_name, })
|
207
|
-
|
208
|
-
payload = @version.update(
|
209
|
-
'POST',
|
210
|
-
@uri,
|
211
|
-
data: data,
|
212
|
-
)
|
213
|
-
|
214
|
-
ServiceInstance.new(@version, payload, sid: @solution[:sid], )
|
215
|
-
end
|
216
|
-
|
217
|
-
##
|
218
|
-
# Access the entities
|
219
|
-
# @return [EntityList]
|
220
|
-
# @return [EntityContext] if identity was passed.
|
221
|
-
def entities(identity=:unset)
|
222
|
-
raise ArgumentError, 'identity cannot be nil' if identity.nil?
|
223
|
-
|
224
|
-
if identity != :unset
|
225
|
-
return EntityContext.new(@version, @solution[:sid], identity, )
|
226
|
-
end
|
227
|
-
|
228
|
-
unless @entities
|
229
|
-
@entities = EntityList.new(@version, service_sid: @solution[:sid], )
|
230
|
-
end
|
231
|
-
|
232
|
-
@entities
|
233
|
-
end
|
234
|
-
|
235
|
-
##
|
236
|
-
# Provide a user friendly representation
|
237
|
-
def to_s
|
238
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
239
|
-
"#<Twilio.Preview.Authy.ServiceContext #{context}>"
|
240
|
-
end
|
241
|
-
end
|
242
|
-
|
243
|
-
##
|
244
|
-
# 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.
|
245
|
-
class ServiceInstance < InstanceResource
|
246
|
-
##
|
247
|
-
# Initialize the ServiceInstance
|
248
|
-
# @param [Version] version Version that contains the resource
|
249
|
-
# @param [Hash] payload payload that contains response from Twilio
|
250
|
-
# @param [String] sid A 34 character string that uniquely identifies this Service.
|
251
|
-
# @return [ServiceInstance] ServiceInstance
|
252
|
-
def initialize(version, payload, sid: nil)
|
253
|
-
super(version)
|
254
|
-
|
255
|
-
# Marshaled Properties
|
256
|
-
@properties = {
|
257
|
-
'sid' => payload['sid'],
|
258
|
-
'friendly_name' => payload['friendly_name'],
|
259
|
-
'account_sid' => payload['account_sid'],
|
260
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
261
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
262
|
-
'url' => payload['url'],
|
263
|
-
'links' => payload['links'],
|
264
|
-
}
|
265
|
-
|
266
|
-
# Context
|
267
|
-
@instance_context = nil
|
268
|
-
@params = {'sid' => sid || @properties['sid'], }
|
269
|
-
end
|
270
|
-
|
271
|
-
##
|
272
|
-
# Generate an instance context for the instance, the context is capable of
|
273
|
-
# performing various actions. All instance actions are proxied to the context
|
274
|
-
# @return [ServiceContext] ServiceContext for this ServiceInstance
|
275
|
-
def context
|
276
|
-
unless @instance_context
|
277
|
-
@instance_context = ServiceContext.new(@version, @params['sid'], )
|
278
|
-
end
|
279
|
-
@instance_context
|
280
|
-
end
|
281
|
-
|
282
|
-
##
|
283
|
-
# @return [String] A string that uniquely identifies this Service.
|
284
|
-
def sid
|
285
|
-
@properties['sid']
|
286
|
-
end
|
287
|
-
|
288
|
-
##
|
289
|
-
# @return [String] A human readable description of this resource.
|
290
|
-
def friendly_name
|
291
|
-
@properties['friendly_name']
|
292
|
-
end
|
293
|
-
|
294
|
-
##
|
295
|
-
# @return [String] Account Sid.
|
296
|
-
def account_sid
|
297
|
-
@properties['account_sid']
|
298
|
-
end
|
299
|
-
|
300
|
-
##
|
301
|
-
# @return [Time] The date this Service was created
|
302
|
-
def date_created
|
303
|
-
@properties['date_created']
|
304
|
-
end
|
305
|
-
|
306
|
-
##
|
307
|
-
# @return [Time] The date this Service was updated
|
308
|
-
def date_updated
|
309
|
-
@properties['date_updated']
|
310
|
-
end
|
311
|
-
|
312
|
-
##
|
313
|
-
# @return [String] The URL of this resource.
|
314
|
-
def url
|
315
|
-
@properties['url']
|
316
|
-
end
|
317
|
-
|
318
|
-
##
|
319
|
-
# @return [String] Nested resource URLs.
|
320
|
-
def links
|
321
|
-
@properties['links']
|
322
|
-
end
|
323
|
-
|
324
|
-
##
|
325
|
-
# Fetch a ServiceInstance
|
326
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
327
|
-
def fetch
|
328
|
-
context.fetch
|
329
|
-
end
|
330
|
-
|
331
|
-
##
|
332
|
-
# Update the ServiceInstance
|
333
|
-
# @param [String] friendly_name A human readable description of this resource, up
|
334
|
-
# to 64 characters.
|
335
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
336
|
-
def update(friendly_name: :unset)
|
337
|
-
context.update(friendly_name: friendly_name, )
|
338
|
-
end
|
339
|
-
|
340
|
-
##
|
341
|
-
# Access the entities
|
342
|
-
# @return [entities] entities
|
343
|
-
def entities
|
344
|
-
context.entities
|
345
|
-
end
|
346
|
-
|
347
|
-
##
|
348
|
-
# Provide a user friendly representation
|
349
|
-
def to_s
|
350
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
351
|
-
"<Twilio.Preview.Authy.ServiceInstance #{values}>"
|
352
|
-
end
|
353
|
-
|
354
|
-
##
|
355
|
-
# Provide a detailed, user friendly representation
|
356
|
-
def inspect
|
357
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
358
|
-
"<Twilio.Preview.Authy.ServiceInstance #{values}>"
|
359
|
-
end
|
360
|
-
end
|
361
|
-
end
|
362
|
-
end
|
363
|
-
end
|
364
|
-
end
|