Class: Twilio::REST::Preview::DeployedDevices::FleetContext::DeviceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::DeployedDevices::FleetContext::DeviceInstance
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Specifies the unique string identifier of the Account responsible for this Device.
-
#context ⇒ DeviceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_authenticated ⇒ Time
Specifies the date this Device was last authenticated, given in UTC ISO 8601 format.
-
#date_created ⇒ Time
Specifies the date this Device was created, given in UTC ISO 8601 format.
-
#date_updated ⇒ Time
Specifies the date this Device was last updated, given in UTC ISO 8601 format.
-
#delete ⇒ Boolean
Delete the DeviceInstance.
-
#deployment_sid ⇒ String
Specifies the unique string identifier of the Deployment group that this Device is associated with.
-
#enabled ⇒ Boolean
Contains a boolean flag indicating whether the device is enabled or not, blocks device connectivity if set to false.
-
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance.
-
#fleet_sid ⇒ String
Specifies the unique string identifier of the Fleet that the given Device belongs to.
-
#friendly_name ⇒ String
Contains a human readable descriptive text for this Device, up to 256 characters long.
-
#identity ⇒ String
Contains an arbitrary string identifier representing a human user associated with this Device, assigned by the developer, up to 256 characters long.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeviceInstance
constructor
Initialize the DeviceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
Contains a 34 character string that uniquely identifies this Device resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
Contains a unique and addressable name of this Device, assigned by the developer, up to 128 characters long.
-
#update(friendly_name: :unset, identity: :unset, deployment_sid: :unset, enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance.
-
#url ⇒ String
Contains an absolute URL for this Device resource.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeviceInstance
Initialize the DeviceInstance
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 290 def initialize(version, payload , fleet_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'url' => payload['url'], 'unique_name' => payload['unique_name'], 'friendly_name' => payload['friendly_name'], 'fleet_sid' => payload['fleet_sid'], 'enabled' => payload['enabled'], 'account_sid' => payload['account_sid'], 'identity' => payload['identity'], 'deployment_sid' => payload['deployment_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'date_authenticated' => Twilio.deserialize_iso8601_datetime(payload['date_authenticated']), } # Context @instance_context = nil @params = { 'fleet_sid' => fleet_sid || @properties['fleet_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns Specifies the unique string identifier of the Account responsible for this Device.
363 364 365 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 363 def account_sid @properties['account_sid'] 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
318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 318 def context unless @instance_context @instance_context = DeviceContext.new(@version , @params['fleet_sid'], @params['sid']) end @instance_context end |
#date_authenticated ⇒ Time
Returns Specifies the date this Device was last authenticated, given in UTC ISO 8601 format.
393 394 395 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 393 def date_authenticated @properties['date_authenticated'] end |
#date_created ⇒ Time
Returns Specifies the date this Device was created, given in UTC ISO 8601 format.
381 382 383 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 381 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns Specifies the date this Device was last updated, given in UTC ISO 8601 format.
387 388 389 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 387 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the DeviceInstance
400 401 402 403 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 400 def delete context.delete end |
#deployment_sid ⇒ String
Returns Specifies the unique string identifier of the Deployment group that this Device is associated with.
375 376 377 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 375 def deployment_sid @properties['deployment_sid'] end |
#enabled ⇒ Boolean
Returns Contains a boolean flag indicating whether the device is enabled or not, blocks device connectivity if set to false.
357 358 359 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 357 def enabled @properties['enabled'] end |
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance
408 409 410 411 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 408 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns Specifies the unique string identifier of the Fleet that the given Device belongs to.
351 352 353 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 351 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns Contains a human readable descriptive text for this Device, up to 256 characters long.
345 346 347 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 345 def friendly_name @properties['friendly_name'] end |
#identity ⇒ String
Returns Contains an arbitrary string identifier representing a human user associated with this Device, assigned by the developer, up to 256 characters long.
369 370 371 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 369 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
444 445 446 447 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 444 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.DeviceInstance #{values}>" end |
#sid ⇒ String
Returns Contains a 34 character string that uniquely identifies this Device resource.
327 328 329 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 327 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
437 438 439 440 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 437 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.DeviceInstance #{values}>" end |
#unique_name ⇒ String
Returns Contains a unique and addressable name of this Device, assigned by the developer, up to 128 characters long.
339 340 341 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 339 def unique_name @properties['unique_name'] end |
#update(friendly_name: :unset, identity: :unset, deployment_sid: :unset, enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance
420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 420 def update( friendly_name: :unset, identity: :unset, deployment_sid: :unset, enabled: :unset ) context.update( friendly_name: friendly_name, identity: identity, deployment_sid: deployment_sid, enabled: enabled, ) end |
#url ⇒ String
Returns Contains an absolute URL for this Device resource.
333 334 335 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb', line 333 def url @properties['url'] end |