class Twilio::REST::Preview::DeployedDevices::FleetContext::DeviceInstance
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 DeviceInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] fleet_sid
Specifies the unique string identifier of the Fleet
that the given Device belongs to.
@param [String] sid Provides a 34 character string that uniquely identifies the
requested Device resource.
@return [DeviceInstance] DeviceInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 267 def initialize(version, payload, fleet_sid: nil, sid: nil) 268 super(version) 269 270 # Marshaled Properties 271 @properties = { 272 'sid' => payload['sid'], 273 'url' => payload['url'], 274 'unique_name' => payload['unique_name'], 275 'friendly_name' => payload['friendly_name'], 276 'fleet_sid' => payload['fleet_sid'], 277 'enabled' => payload['enabled'], 278 'account_sid' => payload['account_sid'], 279 'identity' => payload['identity'], 280 'deployment_sid' => payload['deployment_sid'], 281 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 282 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 283 'date_authenticated' => Twilio.deserialize_iso8601_datetime(payload['date_authenticated']), 284 } 285 286 # Context 287 @instance_context = nil 288 @params = {'fleet_sid' => fleet_sid, 'sid' => sid || @properties['sid'], } 289 end
Public Instance Methods
@return [String] The unique SID that identifies this Account.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 340 def account_sid 341 @properties['account_sid'] 342 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DeviceContext] DeviceContext
for this DeviceInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 295 def context 296 unless @instance_context 297 @instance_context = DeviceContext.new(@version, @params['fleet_sid'], @params['sid'], ) 298 end 299 @instance_context 300 end
@return [Time] The date this Device was authenticated.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 370 def date_authenticated 371 @properties['date_authenticated'] 372 end
@return [Time] The date this Device was created.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 358 def date_created 359 @properties['date_created'] 360 end
@return [Time] The date this Device was updated.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 364 def date_updated 365 @properties['date_updated'] 366 end
Delete the DeviceInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 384 def delete 385 context.delete 386 end
@return [String] The unique SID of the Deployment group.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 352 def deployment_sid 353 @properties['deployment_sid'] 354 end
@return [Boolean] Device enabled flag.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 334 def enabled 335 @properties['enabled'] 336 end
Fetch the DeviceInstance
@return [DeviceInstance] Fetched DeviceInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 377 def fetch 378 context.fetch 379 end
@return [String] The unique identifier of the Fleet.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 328 def fleet_sid 329 @properties['fleet_sid'] 330 end
@return [String] A human readable description for this Device
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 322 def friendly_name 323 @properties['friendly_name'] 324 end
@return [String] An identifier of the Device user.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 346 def identity 347 @properties['identity'] 348 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 416 def inspect 417 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 418 "<Twilio.Preview.DeployedDevices.DeviceInstance #{values}>" 419 end
@return [String] A string that uniquely identifies this Device.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 304 def sid 305 @properties['sid'] 306 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 409 def to_s 410 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 411 "<Twilio.Preview.DeployedDevices.DeviceInstance #{values}>" 412 end
@return [String] A unique, addressable name of this Device.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 316 def unique_name 317 @properties['unique_name'] 318 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 398 def update(friendly_name: :unset, identity: :unset, deployment_sid: :unset, enabled: :unset) 399 context.update( 400 friendly_name: friendly_name, 401 identity: identity, 402 deployment_sid: deployment_sid, 403 enabled: enabled, 404 ) 405 end
@return [String] URL of this Device.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb 310 def url 311 @properties['url'] 312 end