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
Overview
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 [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
Account SID.
-
#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.
-
#date_updated ⇒ Time
The date that this Device was last updated.
-
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance.
-
#initialize(version, payload, sid: nil) ⇒ DeviceInstance
constructor
Initialize the DeviceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#logging ⇒ Hash
Object specifying whether application logging is enabled for this Device.
-
#sid ⇒ String
A 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
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 216 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'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account SID.
261 262 263 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 261 def account_sid @properties['account_sid'] end |
#app ⇒ Hash
Returns Information about the target App and the App reported by this Device.
267 268 269 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 267 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
240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 240 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.
279 280 281 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 279 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Device was last updated.
285 286 287 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 285 def date_updated @properties['date_updated'] end |
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance
298 299 300 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 298 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
324 325 326 327 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 324 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceInstance #{values}>" end |
#logging ⇒ Hash
Returns Object specifying whether application logging is enabled for this Device.
273 274 275 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 273 def logging @properties['logging'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Device.
249 250 251 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 249 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
317 318 319 320 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 317 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.
255 256 257 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 255 def unique_name @properties['unique_name'] end |
#update(unique_name: :unset, target_app: :unset, logging_enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance
311 312 313 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 311 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.
291 292 293 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 291 def url @properties['url'] end |