Class: Twilio::REST::Microvisor::V1::DeviceContext::DeviceSecretInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Microvisor::V1::DeviceContext::DeviceSecretInstance
- Defined in:
- lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb
Instance Method Summary collapse
-
#context ⇒ DeviceSecretContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #date_rotated ⇒ Time
-
#delete ⇒ Boolean
Delete the DeviceSecretInstance.
-
#device_sid ⇒ String
A 34-character string that uniquely identifies the parent Device.
-
#fetch ⇒ DeviceSecretInstance
Fetch the DeviceSecretInstance.
-
#initialize(version, payload, device_sid: nil, key: nil) ⇒ DeviceSecretInstance
constructor
Initialize the DeviceSecretInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#key ⇒ String
The secret key; up to 100 characters.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(value: nil) ⇒ DeviceSecretInstance
Update the DeviceSecretInstance.
-
#url ⇒ String
The absolute URL of the Secret.
Constructor Details
#initialize(version, payload, device_sid: nil, key: nil) ⇒ DeviceSecretInstance
Initialize the DeviceSecretInstance
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 290 def initialize(version, payload , device_sid: nil, key: nil) super(version) # Marshaled Properties @properties = { 'device_sid' => payload['device_sid'], 'key' => payload['key'], 'date_rotated' => Twilio.deserialize_iso8601_datetime(payload['date_rotated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'device_sid' => device_sid || @properties['device_sid'] ,'key' => key || @properties['key'] , } end |
Instance Method Details
#context ⇒ DeviceSecretContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
310 311 312 313 314 315 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 310 def context unless @instance_context @instance_context = DeviceSecretContext.new(@version , @params['device_sid'], @params['key']) end @instance_context end |
#date_rotated ⇒ Time
331 332 333 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 331 def date_rotated @properties['date_rotated'] end |
#delete ⇒ Boolean
Delete the DeviceSecretInstance
344 345 346 347 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 344 def delete context.delete end |
#device_sid ⇒ String
Returns A 34-character string that uniquely identifies the parent Device.
319 320 321 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 319 def device_sid @properties['device_sid'] end |
#fetch ⇒ DeviceSecretInstance
Fetch the DeviceSecretInstance
352 353 354 355 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 352 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
379 380 381 382 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 379 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>" end |
#key ⇒ String
Returns The secret key; up to 100 characters.
325 326 327 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 325 def key @properties['key'] end |
#to_s ⇒ Object
Provide a user friendly representation
372 373 374 375 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 372 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>" end |
#update(value: nil) ⇒ DeviceSecretInstance
Update the DeviceSecretInstance
361 362 363 364 365 366 367 368 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 361 def update( value: nil ) context.update( value: value, ) end |
#url ⇒ String
Returns The absolute URL of the Secret.
337 338 339 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 337 def url @properties['url'] end |