lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb in twilio-ruby-6.9.1 vs lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb in twilio-ruby-6.11.0
- old
+ new
@@ -18,10 +18,11 @@
class Preview < PreviewBase
class DeployedDevices < Version
class FleetContext < InstanceContext
class KeyList < ListResource
+
##
# Initialize the KeyList
# @param [Version] version Version that contains the resource
# @return [KeyList] KeyList
def initialize(version, fleet_sid: nil)
@@ -44,10 +45,11 @@
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'DeviceSid' => device_sid,
})
+
payload = @version.create('POST', @uri, data: data)
KeyInstance.new(
@version,
payload,
fleet_sid: @solution[:fleet_sid],
@@ -175,18 +177,20 @@
##
# Delete the KeyInstance
# @return [Boolean] True if delete succeeds, false otherwise
def delete
+
@version.delete('DELETE', @uri)
end
##
# Fetch the KeyInstance
# @return [KeyInstance] Fetched KeyInstance
def fetch
+
payload = @version.fetch('GET', @uri)
KeyInstance.new(
@version,
payload,
fleet_sid: @solution[:fleet_sid],
@@ -207,9 +211,10 @@
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'DeviceSid' => device_sid,
})
+
payload = @version.update('POST', @uri, data: data)
KeyInstance.new(
@version,
payload,
fleet_sid: @solution[:fleet_sid],