twilio-ruby 7.3.2 → 7.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +22 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/iam/v1/{new_api_key.rb → key.rb} +20 -20
- data/lib/twilio-ruby/rest/iam/v1.rb +4 -4
- data/lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb +239 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +15 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +8 -2
- data/lib/twilio-ruby/rest/preview_base.rb +0 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +4 -1
- data/lib/twilio-ruby/rest/video/v1/room.rb +14 -14
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -9
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -424
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +0 -408
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -463
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +0 -421
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -511
- data/lib/twilio-ruby/rest/preview/deployed_devices.rb +0 -49
@@ -35,14 +35,14 @@ module Twilio
|
|
35
35
|
# @param [Boolean] enable_turn Deprecated, now always considered to be true.
|
36
36
|
# @param [RoomType] type
|
37
37
|
# @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`.
|
38
|
-
# @param [String] status_callback The URL
|
39
|
-
# @param [String] status_callback_method The HTTP method
|
40
|
-
# @param [String] max_participants The maximum number of concurrent Participants allowed in the room.
|
41
|
-
# @param [Boolean] record_participants_on_connect Whether to start recording when Participants connect.
|
42
|
-
# @param [Array[VideoCodec]] video_codecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`.
|
43
|
-
# @param [String] media_region The region for the media server
|
38
|
+
# @param [String] status_callback The URL Twilio should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info.
|
39
|
+
# @param [String] status_callback_method The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`.
|
40
|
+
# @param [String] max_participants The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50.
|
41
|
+
# @param [Boolean] record_participants_on_connect Whether to start recording when Participants connect.
|
42
|
+
# @param [Array[VideoCodec]] video_codecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`.
|
43
|
+
# @param [String] media_region The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers).
|
44
44
|
# @param [Object] recording_rules A collection of Recording Rules that describe how to include or exclude matching tracks for recording
|
45
|
-
# @param [Boolean] audio_only When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
|
45
|
+
# @param [Boolean] audio_only When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
|
46
46
|
# @param [String] max_participant_duration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours).
|
47
47
|
# @param [String] empty_room_timeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions).
|
48
48
|
# @param [String] unused_room_timeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions).
|
@@ -417,7 +417,7 @@ module Twilio
|
|
417
417
|
end
|
418
418
|
|
419
419
|
##
|
420
|
-
# @return [String] The unique string that
|
420
|
+
# @return [String] The unique string that Twilio created to identify the Room resource.
|
421
421
|
def sid
|
422
422
|
@properties['sid']
|
423
423
|
end
|
@@ -459,13 +459,13 @@ module Twilio
|
|
459
459
|
end
|
460
460
|
|
461
461
|
##
|
462
|
-
# @return [String] The URL
|
462
|
+
# @return [String] The URL Twilio calls using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info.
|
463
463
|
def status_callback
|
464
464
|
@properties['status_callback']
|
465
465
|
end
|
466
466
|
|
467
467
|
##
|
468
|
-
# @return [String] The HTTP method
|
468
|
+
# @return [String] The HTTP method Twilio uses to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`.
|
469
469
|
def status_callback_method
|
470
470
|
@properties['status_callback_method']
|
471
471
|
end
|
@@ -507,25 +507,25 @@ module Twilio
|
|
507
507
|
end
|
508
508
|
|
509
509
|
##
|
510
|
-
# @return [Boolean] Whether to start recording when Participants connect.
|
510
|
+
# @return [Boolean] Whether to start recording when Participants connect.
|
511
511
|
def record_participants_on_connect
|
512
512
|
@properties['record_participants_on_connect']
|
513
513
|
end
|
514
514
|
|
515
515
|
##
|
516
|
-
# @return [Array<VideoCodec>] An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`.
|
516
|
+
# @return [Array<VideoCodec>] An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`.
|
517
517
|
def video_codecs
|
518
518
|
@properties['video_codecs']
|
519
519
|
end
|
520
520
|
|
521
521
|
##
|
522
|
-
# @return [String] The region for the media server
|
522
|
+
# @return [String] The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#media-servers).
|
523
523
|
def media_region
|
524
524
|
@properties['media_region']
|
525
525
|
end
|
526
526
|
|
527
527
|
##
|
528
|
-
# @return [Boolean] When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
|
528
|
+
# @return [Boolean] When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
|
529
529
|
def audio_only
|
530
530
|
@properties['audio_only']
|
531
531
|
end
|
data/lib/twilio-ruby/version.rb
CHANGED
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: 7.3.
|
4
|
+
version: 7.3.4
|
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: 2024-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -481,7 +481,7 @@ files:
|
|
481
481
|
- lib/twilio-ruby/rest/iam/v1.rb
|
482
482
|
- lib/twilio-ruby/rest/iam/v1/api_key.rb
|
483
483
|
- lib/twilio-ruby/rest/iam/v1/get_api_keys.rb
|
484
|
-
- lib/twilio-ruby/rest/iam/v1/
|
484
|
+
- lib/twilio-ruby/rest/iam/v1/key.rb
|
485
485
|
- lib/twilio-ruby/rest/iam_base.rb
|
486
486
|
- lib/twilio-ruby/rest/insights.rb
|
487
487
|
- lib/twilio-ruby/rest/insights/v1.rb
|
@@ -564,6 +564,7 @@ files:
|
|
564
564
|
- lib/twilio-ruby/rest/messaging/v1/external_campaign.rb
|
565
565
|
- lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb
|
566
566
|
- lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb
|
567
|
+
- lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb
|
567
568
|
- lib/twilio-ruby/rest/messaging/v1/service.rb
|
568
569
|
- lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb
|
569
570
|
- lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb
|
@@ -631,12 +632,6 @@ files:
|
|
631
632
|
- lib/twilio-ruby/rest/oauth/v1/token.rb
|
632
633
|
- lib/twilio-ruby/rest/oauth_base.rb
|
633
634
|
- lib/twilio-ruby/rest/preview.rb
|
634
|
-
- lib/twilio-ruby/rest/preview/deployed_devices.rb
|
635
|
-
- lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
|
636
|
-
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
|
637
|
-
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb
|
638
|
-
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb
|
639
|
-
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb
|
640
635
|
- lib/twilio-ruby/rest/preview/hosted_numbers.rb
|
641
636
|
- lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb
|
642
637
|
- lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb
|
@@ -1,424 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
-
#
|
7
|
-
# Twilio - Preview
|
8
|
-
# This is the public Twilio REST API.
|
9
|
-
#
|
10
|
-
# NOTE: This class is auto generated by OpenAPI Generator.
|
11
|
-
# https://openapi-generator.tech
|
12
|
-
# Do not edit the class manually.
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
module Twilio
|
17
|
-
module REST
|
18
|
-
class Preview < PreviewBase
|
19
|
-
class DeployedDevices < Version
|
20
|
-
class FleetContext < InstanceContext
|
21
|
-
|
22
|
-
class CertificateList < ListResource
|
23
|
-
|
24
|
-
##
|
25
|
-
# Initialize the CertificateList
|
26
|
-
# @param [Version] version Version that contains the resource
|
27
|
-
# @return [CertificateList] CertificateList
|
28
|
-
def initialize(version, fleet_sid: nil)
|
29
|
-
super(version)
|
30
|
-
# Path Solution
|
31
|
-
@solution = { fleet_sid: fleet_sid }
|
32
|
-
@uri = "/Fleets/#{@solution[:fleet_sid]}/Certificates"
|
33
|
-
|
34
|
-
end
|
35
|
-
##
|
36
|
-
# Create the CertificateInstance
|
37
|
-
# @param [String] certificate_data Provides a URL encoded representation of the public certificate in PEM format.
|
38
|
-
# @param [String] friendly_name Provides a human readable descriptive text for this Certificate credential, up to 256 characters long.
|
39
|
-
# @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential.
|
40
|
-
# @return [CertificateInstance] Created CertificateInstance
|
41
|
-
def create(
|
42
|
-
certificate_data: nil,
|
43
|
-
friendly_name: :unset,
|
44
|
-
device_sid: :unset
|
45
|
-
)
|
46
|
-
|
47
|
-
data = Twilio::Values.of({
|
48
|
-
'CertificateData' => certificate_data,
|
49
|
-
'FriendlyName' => friendly_name,
|
50
|
-
'DeviceSid' => device_sid,
|
51
|
-
})
|
52
|
-
|
53
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
54
|
-
|
55
|
-
payload = @version.create('POST', @uri, data: data, headers: headers)
|
56
|
-
CertificateInstance.new(
|
57
|
-
@version,
|
58
|
-
payload,
|
59
|
-
fleet_sid: @solution[:fleet_sid],
|
60
|
-
)
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
##
|
65
|
-
# Lists CertificateInstance records from the API as a list.
|
66
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
67
|
-
# memory before returning.
|
68
|
-
# @param [String] device_sid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device.
|
69
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
70
|
-
# guarantees to never return more than limit. Default is no limit
|
71
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
72
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
73
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
74
|
-
# efficient page size, i.e. min(limit, 1000)
|
75
|
-
# @return [Array] Array of up to limit results
|
76
|
-
def list(device_sid: :unset, limit: nil, page_size: nil)
|
77
|
-
self.stream(
|
78
|
-
device_sid: device_sid,
|
79
|
-
limit: limit,
|
80
|
-
page_size: page_size
|
81
|
-
).entries
|
82
|
-
end
|
83
|
-
|
84
|
-
##
|
85
|
-
# Streams Instance records from the API as an Enumerable.
|
86
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
87
|
-
# is reached.
|
88
|
-
# @param [String] device_sid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device.
|
89
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
90
|
-
# guarantees to never return more than limit. Default is no limit
|
91
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
92
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
93
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
94
|
-
# efficient page size, i.e. min(limit, 1000)
|
95
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
96
|
-
def stream(device_sid: :unset, limit: nil, page_size: nil)
|
97
|
-
limits = @version.read_limits(limit, page_size)
|
98
|
-
|
99
|
-
page = self.page(
|
100
|
-
device_sid: device_sid,
|
101
|
-
page_size: limits[:page_size], )
|
102
|
-
|
103
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
104
|
-
end
|
105
|
-
|
106
|
-
##
|
107
|
-
# When passed a block, yields CertificateInstance records from the API.
|
108
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
109
|
-
# is reached.
|
110
|
-
def each
|
111
|
-
limits = @version.read_limits
|
112
|
-
|
113
|
-
page = self.page(page_size: limits[:page_size], )
|
114
|
-
|
115
|
-
@version.stream(page,
|
116
|
-
limit: limits[:limit],
|
117
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
118
|
-
end
|
119
|
-
|
120
|
-
##
|
121
|
-
# Retrieve a single page of CertificateInstance records from the API.
|
122
|
-
# Request is executed immediately.
|
123
|
-
# @param [String] device_sid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device.
|
124
|
-
# @param [String] page_token PageToken provided by the API
|
125
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
126
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
127
|
-
# @return [Page] Page of CertificateInstance
|
128
|
-
def page(device_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
129
|
-
params = Twilio::Values.of({
|
130
|
-
'DeviceSid' => device_sid,
|
131
|
-
'PageToken' => page_token,
|
132
|
-
'Page' => page_number,
|
133
|
-
'PageSize' => page_size,
|
134
|
-
})
|
135
|
-
|
136
|
-
response = @version.page('GET', @uri, params: params)
|
137
|
-
|
138
|
-
CertificatePage.new(@version, response, @solution)
|
139
|
-
end
|
140
|
-
|
141
|
-
##
|
142
|
-
# Retrieve a single page of CertificateInstance records from the API.
|
143
|
-
# Request is executed immediately.
|
144
|
-
# @param [String] target_url API-generated URL for the requested results page
|
145
|
-
# @return [Page] Page of CertificateInstance
|
146
|
-
def get_page(target_url)
|
147
|
-
response = @version.domain.request(
|
148
|
-
'GET',
|
149
|
-
target_url
|
150
|
-
)
|
151
|
-
CertificatePage.new(@version, response, @solution)
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
# Provide a user friendly representation
|
157
|
-
def to_s
|
158
|
-
'#<Twilio.Preview.DeployedDevices.CertificateList>'
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
|
163
|
-
class CertificateContext < InstanceContext
|
164
|
-
##
|
165
|
-
# Initialize the CertificateContext
|
166
|
-
# @param [Version] version Version that contains the resource
|
167
|
-
# @param [String] fleet_sid
|
168
|
-
# @param [String] sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource.
|
169
|
-
# @return [CertificateContext] CertificateContext
|
170
|
-
def initialize(version, fleet_sid, sid)
|
171
|
-
super(version)
|
172
|
-
|
173
|
-
# Path Solution
|
174
|
-
@solution = { fleet_sid: fleet_sid, sid: sid, }
|
175
|
-
@uri = "/Fleets/#{@solution[:fleet_sid]}/Certificates/#{@solution[:sid]}"
|
176
|
-
|
177
|
-
|
178
|
-
end
|
179
|
-
##
|
180
|
-
# Delete the CertificateInstance
|
181
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
182
|
-
def delete
|
183
|
-
|
184
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
185
|
-
|
186
|
-
@version.delete('DELETE', @uri, headers: headers)
|
187
|
-
end
|
188
|
-
|
189
|
-
##
|
190
|
-
# Fetch the CertificateInstance
|
191
|
-
# @return [CertificateInstance] Fetched CertificateInstance
|
192
|
-
def fetch
|
193
|
-
|
194
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
195
|
-
|
196
|
-
payload = @version.fetch('GET', @uri, headers: headers)
|
197
|
-
CertificateInstance.new(
|
198
|
-
@version,
|
199
|
-
payload,
|
200
|
-
fleet_sid: @solution[:fleet_sid],
|
201
|
-
sid: @solution[:sid],
|
202
|
-
)
|
203
|
-
end
|
204
|
-
|
205
|
-
##
|
206
|
-
# Update the CertificateInstance
|
207
|
-
# @param [String] friendly_name Provides a human readable descriptive text for this Certificate credential, up to 256 characters long.
|
208
|
-
# @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential.
|
209
|
-
# @return [CertificateInstance] Updated CertificateInstance
|
210
|
-
def update(
|
211
|
-
friendly_name: :unset,
|
212
|
-
device_sid: :unset
|
213
|
-
)
|
214
|
-
|
215
|
-
data = Twilio::Values.of({
|
216
|
-
'FriendlyName' => friendly_name,
|
217
|
-
'DeviceSid' => device_sid,
|
218
|
-
})
|
219
|
-
|
220
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
221
|
-
|
222
|
-
payload = @version.update('POST', @uri, data: data, headers: headers)
|
223
|
-
CertificateInstance.new(
|
224
|
-
@version,
|
225
|
-
payload,
|
226
|
-
fleet_sid: @solution[:fleet_sid],
|
227
|
-
sid: @solution[:sid],
|
228
|
-
)
|
229
|
-
end
|
230
|
-
|
231
|
-
|
232
|
-
##
|
233
|
-
# Provide a user friendly representation
|
234
|
-
def to_s
|
235
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
236
|
-
"#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>"
|
237
|
-
end
|
238
|
-
|
239
|
-
##
|
240
|
-
# Provide a detailed, user friendly representation
|
241
|
-
def inspect
|
242
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
243
|
-
"#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>"
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
class CertificatePage < Page
|
248
|
-
##
|
249
|
-
# Initialize the CertificatePage
|
250
|
-
# @param [Version] version Version that contains the resource
|
251
|
-
# @param [Response] response Response from the API
|
252
|
-
# @param [Hash] solution Path solution for the resource
|
253
|
-
# @return [CertificatePage] CertificatePage
|
254
|
-
def initialize(version, response, solution)
|
255
|
-
super(version, response)
|
256
|
-
|
257
|
-
# Path Solution
|
258
|
-
@solution = solution
|
259
|
-
end
|
260
|
-
|
261
|
-
##
|
262
|
-
# Build an instance of CertificateInstance
|
263
|
-
# @param [Hash] payload Payload response from the API
|
264
|
-
# @return [CertificateInstance] CertificateInstance
|
265
|
-
def get_instance(payload)
|
266
|
-
CertificateInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid])
|
267
|
-
end
|
268
|
-
|
269
|
-
##
|
270
|
-
# Provide a user friendly representation
|
271
|
-
def to_s
|
272
|
-
'<Twilio.Preview.DeployedDevices.CertificatePage>'
|
273
|
-
end
|
274
|
-
end
|
275
|
-
class CertificateInstance < InstanceResource
|
276
|
-
##
|
277
|
-
# Initialize the CertificateInstance
|
278
|
-
# @param [Version] version Version that contains the resource
|
279
|
-
# @param [Hash] payload payload that contains response from Twilio
|
280
|
-
# @param [String] account_sid The SID of the
|
281
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Certificate
|
282
|
-
# resource.
|
283
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
284
|
-
# @return [CertificateInstance] CertificateInstance
|
285
|
-
def initialize(version, payload , fleet_sid: nil, sid: nil)
|
286
|
-
super(version)
|
287
|
-
|
288
|
-
# Marshaled Properties
|
289
|
-
@properties = {
|
290
|
-
'sid' => payload['sid'],
|
291
|
-
'url' => payload['url'],
|
292
|
-
'friendly_name' => payload['friendly_name'],
|
293
|
-
'fleet_sid' => payload['fleet_sid'],
|
294
|
-
'account_sid' => payload['account_sid'],
|
295
|
-
'device_sid' => payload['device_sid'],
|
296
|
-
'thumbprint' => payload['thumbprint'],
|
297
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
298
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
299
|
-
}
|
300
|
-
|
301
|
-
# Context
|
302
|
-
@instance_context = nil
|
303
|
-
@params = { 'fleet_sid' => fleet_sid || @properties['fleet_sid'] ,'sid' => sid || @properties['sid'] , }
|
304
|
-
end
|
305
|
-
|
306
|
-
##
|
307
|
-
# Generate an instance context for the instance, the context is capable of
|
308
|
-
# performing various actions. All instance actions are proxied to the context
|
309
|
-
# @return [CertificateContext] CallContext for this CallInstance
|
310
|
-
def context
|
311
|
-
unless @instance_context
|
312
|
-
@instance_context = CertificateContext.new(@version , @params['fleet_sid'], @params['sid'])
|
313
|
-
end
|
314
|
-
@instance_context
|
315
|
-
end
|
316
|
-
|
317
|
-
##
|
318
|
-
# @return [String] Contains a 34 character string that uniquely identifies this Certificate credential resource.
|
319
|
-
def sid
|
320
|
-
@properties['sid']
|
321
|
-
end
|
322
|
-
|
323
|
-
##
|
324
|
-
# @return [String] Contains an absolute URL for this Certificate credential resource.
|
325
|
-
def url
|
326
|
-
@properties['url']
|
327
|
-
end
|
328
|
-
|
329
|
-
##
|
330
|
-
# @return [String] Contains a human readable descriptive text for this Certificate credential, up to 256 characters long.
|
331
|
-
def friendly_name
|
332
|
-
@properties['friendly_name']
|
333
|
-
end
|
334
|
-
|
335
|
-
##
|
336
|
-
# @return [String] Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to.
|
337
|
-
def fleet_sid
|
338
|
-
@properties['fleet_sid']
|
339
|
-
end
|
340
|
-
|
341
|
-
##
|
342
|
-
# @return [String] Specifies the unique string identifier of the Account responsible for this Certificate credential.
|
343
|
-
def account_sid
|
344
|
-
@properties['account_sid']
|
345
|
-
end
|
346
|
-
|
347
|
-
##
|
348
|
-
# @return [String] Specifies the unique string identifier of a Device authenticated with this Certificate credential.
|
349
|
-
def device_sid
|
350
|
-
@properties['device_sid']
|
351
|
-
end
|
352
|
-
|
353
|
-
##
|
354
|
-
# @return [String] Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device.
|
355
|
-
def thumbprint
|
356
|
-
@properties['thumbprint']
|
357
|
-
end
|
358
|
-
|
359
|
-
##
|
360
|
-
# @return [Time] Specifies the date this Certificate credential was created, given in UTC ISO 8601 format.
|
361
|
-
def date_created
|
362
|
-
@properties['date_created']
|
363
|
-
end
|
364
|
-
|
365
|
-
##
|
366
|
-
# @return [Time] Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format.
|
367
|
-
def date_updated
|
368
|
-
@properties['date_updated']
|
369
|
-
end
|
370
|
-
|
371
|
-
##
|
372
|
-
# Delete the CertificateInstance
|
373
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
374
|
-
def delete
|
375
|
-
|
376
|
-
context.delete
|
377
|
-
end
|
378
|
-
|
379
|
-
##
|
380
|
-
# Fetch the CertificateInstance
|
381
|
-
# @return [CertificateInstance] Fetched CertificateInstance
|
382
|
-
def fetch
|
383
|
-
|
384
|
-
context.fetch
|
385
|
-
end
|
386
|
-
|
387
|
-
##
|
388
|
-
# Update the CertificateInstance
|
389
|
-
# @param [String] friendly_name Provides a human readable descriptive text for this Certificate credential, up to 256 characters long.
|
390
|
-
# @param [String] device_sid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential.
|
391
|
-
# @return [CertificateInstance] Updated CertificateInstance
|
392
|
-
def update(
|
393
|
-
friendly_name: :unset,
|
394
|
-
device_sid: :unset
|
395
|
-
)
|
396
|
-
|
397
|
-
context.update(
|
398
|
-
friendly_name: friendly_name,
|
399
|
-
device_sid: device_sid,
|
400
|
-
)
|
401
|
-
end
|
402
|
-
|
403
|
-
##
|
404
|
-
# Provide a user friendly representation
|
405
|
-
def to_s
|
406
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
407
|
-
"<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>"
|
408
|
-
end
|
409
|
-
|
410
|
-
##
|
411
|
-
# Provide a detailed, user friendly representation
|
412
|
-
def inspect
|
413
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
414
|
-
"<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>"
|
415
|
-
end
|
416
|
-
end
|
417
|
-
|
418
|
-
end
|
419
|
-
end
|
420
|
-
end
|
421
|
-
end
|
422
|
-
end
|
423
|
-
|
424
|
-
|