Class: Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateInstance
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.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 ⇒ CertificateContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Certificate was created.
-
#date_updated ⇒ Time
The date this Certificate was updated.
-
#delete ⇒ Boolean
Deletes the CertificateInstance.
-
#device_sid ⇒ String
The unique identifier of a mapped Device.
-
#fetch ⇒ CertificateInstance
Fetch a CertificateInstance.
-
#fleet_sid ⇒ String
The unique identifier of the Fleet.
-
#friendly_name ⇒ String
A human readable description for this Certificate.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ CertificateInstance
constructor
Initialize the CertificateInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A string that uniquely identifies this Certificate.
-
#thumbprint ⇒ String
A Certificate unique payload hash.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance.
-
#url ⇒ String
URL of this Certificate.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ CertificateInstance
Initialize the CertificateInstance
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 296 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'], 'thumbprint' => payload['thumbprint'], '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.
361 362 363 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 361 def account_sid @properties['account_sid'] end |
#context ⇒ CertificateContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
324 325 326 327 328 329 330 331 332 333 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 324 def context unless @instance_context @instance_context = CertificateContext.new( @version, @params['fleet_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Certificate was created.
379 380 381 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 379 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Certificate was updated.
385 386 387 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 385 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the CertificateInstance
399 400 401 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 399 def delete context.delete end |
#device_sid ⇒ String
Returns The unique identifier of a mapped Device.
367 368 369 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 367 def device_sid @properties['device_sid'] end |
#fetch ⇒ CertificateInstance
Fetch a CertificateInstance
392 393 394 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 392 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns The unique identifier of the Fleet.
355 356 357 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 355 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns A human readable description for this Certificate.
349 350 351 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 349 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
426 427 428 429 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 426 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>" end |
#sid ⇒ String
Returns A string that uniquely identifies this Certificate.
337 338 339 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 337 def sid @properties['sid'] end |
#thumbprint ⇒ String
Returns A Certificate unique payload hash.
373 374 375 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 373 def thumbprint @properties['thumbprint'] end |
#to_s ⇒ Object
Provide a user friendly representation
419 420 421 422 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 419 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>" end |
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance
410 411 412 413 414 415 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 410 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 Certificate.
343 344 345 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 343 def url @properties['url'] end |