Class: Twilio::REST::Microvisor::V1::DeviceInstance
- Inherits:
 - 
      InstanceResource
      
        
- Object
 - InstanceResource
 - Twilio::REST::Microvisor::V1::DeviceInstance
 
 
- Defined in:
 - lib/twilio-ruby/rest/microvisor/v1/device.rb
 
Instance Method Summary collapse
- 
  
    
      #account_sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
The unique SID identifier of the Account.
 - 
  
    
      #app  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    
Information about the target App and the App reported by this Device.
 - 
  
    
      #context  ⇒ DeviceContext 
    
    
  
  
  
  
  
  
  
  
  
    
Generate an instance context for the instance, the context is capable of performing various actions.
 - 
  
    
      #date_created  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    
The date that this Device was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
 - 
  
    
      #date_updated  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    
The date that this Device was last updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
 - 
  
    
      #device_configs  ⇒ device_configs 
    
    
  
  
  
  
  
  
  
  
  
    
Access the device_configs.
 - 
  
    
      #device_secrets  ⇒ device_secrets 
    
    
  
  
  
  
  
  
  
  
  
    
Access the device_secrets.
 - 
  
    
      #fetch  ⇒ DeviceInstance 
    
    
  
  
  
  
  
  
  
  
  
    
Fetch the DeviceInstance.
 - 
  
    
      #initialize(version, payload, sid: nil)  ⇒ DeviceInstance 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initialize the DeviceInstance.
 - 
  
    
      #inspect  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Provide a detailed, user friendly representation.
 - 
  
    
      #links  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    
The absolute URLs of related resources.
 - 
  
    
      #logging  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    
Object specifying whether application logging is enabled for this Device.
 - 
  
    
      #sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
A 34-character string that uniquely identifies this Device.
 - 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Provide a user friendly representation.
 - 
  
    
      #unique_name  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
A developer-defined string that uniquely identifies the Device.
 - 
  
    
      #update(unique_name: :unset, target_app: :unset, logging_enabled: :unset)  ⇒ DeviceInstance 
    
    
  
  
  
  
  
  
  
  
  
    
Update the DeviceInstance.
 - 
  
    
      #url  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
The URL of this resource.
 
Constructor Details
#initialize(version, payload, sid: nil) ⇒ DeviceInstance
Initialize the DeviceInstance
      277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 277 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'app' => payload['app'], 'logging' => payload['logging'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end  | 
  
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
      323 324 325  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 323 def account_sid @properties['account_sid'] end  | 
  
#app ⇒ Hash
Returns Information about the target App and the App reported by this Device. Contains the properties ‘target_sid`, `date_targeted`, `update_status` (one of `up-to-date`, `pending` and `error`), `update_error_code`, `reported_sid` and `date_reported`.
      329 330 331  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 329 def app @properties['app'] end  | 
  
#context ⇒ DeviceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
      302 303 304 305 306 307  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 302 def context unless @instance_context @instance_context = DeviceContext.new(@version , @params['sid']) end @instance_context end  | 
  
#date_created ⇒ Time
Returns The date that this Device was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
      341 342 343  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 341 def date_created @properties['date_created'] end  | 
  
#date_updated ⇒ Time
Returns The date that this Device was last updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
      347 348 349  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 347 def date_updated @properties['date_updated'] end  | 
  
#device_configs ⇒ device_configs
Access the device_configs
      400 401 402  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 400 def device_configs context.device_configs end  | 
  
#device_secrets ⇒ device_secrets
Access the device_secrets
      393 394 395  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 393 def device_secrets context.device_secrets end  | 
  
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance
      366 367 368 369  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 366 def fetch context.fetch end  | 
  
#inspect ⇒ Object
Provide a detailed, user friendly representation
      413 414 415 416  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 413 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceInstance #{values}>" end  | 
  
#links ⇒ Hash
Returns The absolute URLs of related resources.
      359 360 361  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 359 def links @properties['links'] end  | 
  
#logging ⇒ Hash
Returns Object specifying whether application logging is enabled for this Device. Contains the properties ‘enabled` and `date_expires`.
      335 336 337  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 335 def logging @properties['logging'] end  | 
  
#sid ⇒ String
Returns A 34-character string that uniquely identifies this Device.
      311 312 313  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 311 def sid @properties['sid'] end  | 
  
#to_s ⇒ Object
Provide a user friendly representation
      406 407 408 409  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 406 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceInstance #{values}>" end  | 
  
#unique_name ⇒ String
Returns A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The ‘unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource.
      317 318 319  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 317 def unique_name @properties['unique_name'] end  | 
  
#update(unique_name: :unset, target_app: :unset, logging_enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance
      377 378 379 380 381 382 383 384 385 386 387 388  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 377 def update( unique_name: :unset, target_app: :unset, logging_enabled: :unset ) context.update( unique_name: unique_name, target_app: target_app, logging_enabled: logging_enabled, ) end  | 
  
#url ⇒ String
Returns The URL of this resource.
      353 354 355  | 
    
      # File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 353 def url @properties['url'] end  |