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
Instance Method Summary collapse
-
#account_sid ⇒ String
Specifies the unique string identifier of the Account responsible for this Key credential.
-
#context ⇒ KeyContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Specifies the date this Key credential was created, given in UTC ISO 8601 format.
-
#date_updated ⇒ Time
Specifies the date this Key credential was last updated, given in UTC ISO 8601 format.
-
#delete ⇒ Boolean
Delete the KeyInstance.
-
#device_sid ⇒ String
Specifies the unique string identifier of a Device authenticated with this Key credential.
-
#fetch ⇒ KeyInstance
Fetch the KeyInstance.
-
#fleet_sid ⇒ String
Specifies the unique string identifier of the Fleet that the given Key credential belongs to.
-
#friendly_name ⇒ String
Contains a human readable descriptive text for this Key credential, up to 256 characters long.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ KeyInstance
constructor
Initialize the KeyInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#secret ⇒ String
Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device.
-
#sid ⇒ String
Contains a 34 character string that uniquely identifies this Key credential resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ KeyInstance
Update the KeyInstance.
-
#url ⇒ String
Contains an absolute URL for this Key credential resource.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ KeyInstance
Initialize the KeyInstance
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 277 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 || @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 Key credential.
335 336 337 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 335 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
302 303 304 305 306 307 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 302 def context unless @instance_context @instance_context = KeyContext.new(@version , @params['fleet_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns Specifies the date this Key credential was created, given in UTC ISO 8601 format.
353 354 355 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 353 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns Specifies the date this Key credential was last updated, given in UTC ISO 8601 format.
359 360 361 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 359 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the KeyInstance
366 367 368 369 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 366 def delete context.delete end |
#device_sid ⇒ String
Returns Specifies the unique string identifier of a Device authenticated with this Key credential.
341 342 343 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 341 def device_sid @properties['device_sid'] end |
#fetch ⇒ KeyInstance
Fetch the KeyInstance
374 375 376 377 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 374 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns Specifies the unique string identifier of the Fleet that the given Key credential belongs to.
329 330 331 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 329 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns Contains a human readable descriptive text for this Key credential, up to 256 characters long.
323 324 325 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 323 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
404 405 406 407 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 404 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>" end |
#secret ⇒ String
Returns Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device.
347 348 349 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 347 def secret @properties['secret'] end |
#sid ⇒ String
Returns Contains a 34 character string that uniquely identifies this Key credential resource.
311 312 313 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 311 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
397 398 399 400 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 397 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
384 385 386 387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 384 def update( friendly_name: :unset, device_sid: :unset ) context.update( friendly_name: friendly_name, device_sid: device_sid, ) end |
#url ⇒ String
Returns Contains an absolute URL for this Key credential resource.
317 318 319 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 317 def url @properties['url'] end |