class Twilio::REST::Preview::DeployedDevices::FleetContext::DeviceContext
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.
Public Class Methods
Initialize the DeviceContext
@param [Version] version Version
that contains the resource @param [String] fleet_sid The fleet_sid @param [String] sid Provides a 34 character string that uniquely identifies the
requested Device resource.
@return [DeviceContext] DeviceContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 193 def initialize(version, fleet_sid, sid) 194 super(version) 195 196 # Path Solution 197 @solution = {fleet_sid: fleet_sid, sid: sid, } 198 @uri = "/Fleets/#{@solution[:fleet_sid]}/Devices/#{@solution[:sid]}" 199 end
Public Instance Methods
Delete the DeviceInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 213 def delete 214 @version.delete('DELETE', @uri) 215 end
Fetch the DeviceInstance
@return [DeviceInstance] Fetched DeviceInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 204 def fetch 205 payload = @version.fetch('GET', @uri) 206 207 DeviceInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) 208 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 249 def inspect 250 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 251 "#<Twilio.Preview.DeployedDevices.DeviceContext #{context}>" 252 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 242 def to_s 243 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 244 "#<Twilio.Preview.DeployedDevices.DeviceContext #{context}>" 245 end
Update the DeviceInstance
@param [String] friendly_name Provides a human readable descriptive text to be
assigned to this Device, up to 256 characters long.
@param [String] identity Provides an arbitrary string identifier representing a
human user to be associated with this Device, up to 256 characters long.
@param [String] deployment_sid Specifies the unique string identifier of the
Deployment group that this Device is going to be associated with.
@param [Boolean] enabled The enabled @return [DeviceInstance] Updated DeviceInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 227 def update(friendly_name: :unset, identity: :unset, deployment_sid: :unset, enabled: :unset) 228 data = Twilio::Values.of({ 229 'FriendlyName' => friendly_name, 230 'Identity' => identity, 231 'DeploymentSid' => deployment_sid, 232 'Enabled' => enabled, 233 }) 234 235 payload = @version.update('POST', @uri, data: data) 236 237 DeviceInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) 238 end