Class: Twilio::REST::Preview::DeployedDevices::FleetContext::KeyInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::DeployedDevices::FleetContext::KeyInstance
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.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
The unique SID that identifies this Account.
-
#context ⇒ KeyContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Key credential was created.
-
#date_updated ⇒ Time
The date this Key credential was updated.
-
#delete ⇒ Boolean
Deletes the KeyInstance.
-
#device_sid ⇒ String
The unique identifier of a mapped Device.
-
#fetch ⇒ KeyInstance
Fetch a KeyInstance.
-
#fleet_sid ⇒ String
The unique identifier of the Fleet.
-
#friendly_name ⇒ String
A human readable description for this Key.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ KeyInstance
constructor
Initialize the KeyInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#secret ⇒ String
The key secret.
-
#sid ⇒ String
A string that uniquely identifies this Key.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ KeyInstance
Update the KeyInstance.
-
#url ⇒ String
URL of this Key.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ KeyInstance
Initialize the KeyInstance
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 257 def initialize(version, payload, fleet_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'url' => payload['url'], 'friendly_name' => payload['friendly_name'], 'fleet_sid' => payload['fleet_sid'], 'account_sid' => payload['account_sid'], 'device_sid' => payload['device_sid'], 'secret' => payload['secret'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = {'fleet_sid' => fleet_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID that identifies this Account.
315 316 317 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 315 def account_sid @properties['account_sid'] end |
#context ⇒ KeyContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
282 283 284 285 286 287 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 282 def context unless @instance_context @instance_context = KeyContext.new(@version, @params['fleet_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Key credential was created.
333 334 335 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 333 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Key credential was updated.
339 340 341 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 339 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the KeyInstance
353 354 355 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 353 def delete context.delete end |
#device_sid ⇒ String
Returns The unique identifier of a mapped Device.
321 322 323 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 321 def device_sid @properties['device_sid'] end |
#fetch ⇒ KeyInstance
Fetch a KeyInstance
346 347 348 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 346 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns The unique identifier of the Fleet.
309 310 311 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 309 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns A human readable description for this Key.
303 304 305 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 303 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
377 378 379 380 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 377 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>" end |
#secret ⇒ String
Returns The key secret.
327 328 329 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 327 def secret @properties['secret'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Key.
291 292 293 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 291 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
370 371 372 373 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 370 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>" end |
#update(friendly_name: :unset, device_sid: :unset) ⇒ KeyInstance
Update the KeyInstance
364 365 366 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 364 def update(friendly_name: :unset, device_sid: :unset) context.update(friendly_name: friendly_name, device_sid: device_sid, ) end |
#url ⇒ String
Returns URL of this Key.
297 298 299 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 297 def url @properties['url'] end |