class Twilio::REST::Preview::DeployedDevices::FleetContext::KeyInstance
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 help@twilio.com.
Public Class Methods
Initialize the KeyInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] fleet_sid
Specifies the unique string identifier of the Fleet
that the given Key credential belongs to.
@param [String] sid Provides a 34 character string that uniquely identifies the
requested Key credential resource.
@return [KeyInstance] KeyInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 247 def initialize(version, payload, fleet_sid: nil, sid: nil) 248 super(version) 249 250 # Marshaled Properties 251 @properties = { 252 'sid' => payload['sid'], 253 'url' => payload['url'], 254 'friendly_name' => payload['friendly_name'], 255 'fleet_sid' => payload['fleet_sid'], 256 'account_sid' => payload['account_sid'], 257 'device_sid' => payload['device_sid'], 258 'secret' => payload['secret'], 259 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 260 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 261 } 262 263 # Context 264 @instance_context = nil 265 @params = {'fleet_sid' => fleet_sid, 'sid' => sid || @properties['sid'], } 266 end
Public Instance Methods
@return [String] The unique SID that identifies this Account.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 305 def account_sid 306 @properties['account_sid'] 307 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [KeyContext] KeyContext
for this KeyInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 272 def context 273 unless @instance_context 274 @instance_context = KeyContext.new(@version, @params['fleet_sid'], @params['sid'], ) 275 end 276 @instance_context 277 end
@return [Time] The date this Key credential was created.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 323 def date_created 324 @properties['date_created'] 325 end
@return [Time] The date this Key credential was updated.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 329 def date_updated 330 @properties['date_updated'] 331 end
Delete the KeyInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 343 def delete 344 context.delete 345 end
@return [String] The unique identifier of a mapped Device.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 311 def device_sid 312 @properties['device_sid'] 313 end
Fetch the KeyInstance
@return [KeyInstance] Fetched KeyInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 336 def fetch 337 context.fetch 338 end
@return [String] The unique identifier of the Fleet.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 299 def fleet_sid 300 @properties['fleet_sid'] 301 end
@return [String] A human readable description for this Key.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 293 def friendly_name 294 @properties['friendly_name'] 295 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 367 def inspect 368 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 369 "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>" 370 end
@return [String] The key secret.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 317 def secret 318 @properties['secret'] 319 end
@return [String] A string that uniquely identifies this Key.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 281 def sid 282 @properties['sid'] 283 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 360 def to_s 361 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 362 "<Twilio.Preview.DeployedDevices.KeyInstance #{values}>" 363 end
Update the KeyInstance
@param [String] friendly_name
Provides a human readable descriptive text for
this Key credential, up to 256 characters long.
@param [String] device_sid
Provides the unique string identifier of an existing
Device to become authenticated with this Key credential.
@return [KeyInstance] Updated KeyInstance
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 354 def update(friendly_name: :unset, device_sid: :unset) 355 context.update(friendly_name: friendly_name, device_sid: device_sid, ) 356 end
@return [String] URL of this Key.
# File lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb 287 def url 288 @properties['url'] 289 end