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
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
-
#context ⇒ DeviceSecretContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_rotated ⇒ Time
The date_rotated.
-
#delete ⇒ Boolean
Delete the DeviceSecretInstance.
-
#device_sid ⇒ String
A 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.
-
#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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 244 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, '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
264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 264 def context unless @instance_context @instance_context = DeviceSecretContext.new(@version, @params['device_sid'], @params['key'], ) end @instance_context end |
#date_rotated ⇒ Time
Returns The date_rotated.
285 286 287 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 285 def date_rotated @properties['date_rotated'] end |
#delete ⇒ Boolean
Delete the DeviceSecretInstance
313 314 315 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 313 def delete context.delete end |
#device_sid ⇒ String
Returns A string that uniquely identifies the parent Device.
273 274 275 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 273 def device_sid @properties['device_sid'] end |
#fetch ⇒ DeviceSecretInstance
Fetch the DeviceSecretInstance
298 299 300 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 298 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
326 327 328 329 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 326 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>" end |
#key ⇒ String
Returns The secret key.
279 280 281 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 279 def key @properties['key'] end |
#to_s ⇒ Object
Provide a user friendly representation
319 320 321 322 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 319 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>" end |
#update(value: nil) ⇒ DeviceSecretInstance
Update the DeviceSecretInstance
306 307 308 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 306 def update(value: nil) context.update(value: value, ) end |
#url ⇒ String
Returns The absolute URL of the Secret.
291 292 293 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb', line 291 def url @properties['url'] end |