class Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateInstance

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

new(version, payload, fleet_sid: nil, sid: nil) click to toggle source

Initialize the CertificateInstance @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 Certificate credential belongs to.

@param [String] sid Provides a 34 character string that uniquely identifies the

requested Certificate credential resource.

@return [CertificateInstance] CertificateInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
253 def initialize(version, payload, fleet_sid: nil, sid: nil)
254   super(version)
255 
256   # Marshaled Properties
257   @properties = {
258       'sid' => payload['sid'],
259       'url' => payload['url'],
260       'friendly_name' => payload['friendly_name'],
261       'fleet_sid' => payload['fleet_sid'],
262       'account_sid' => payload['account_sid'],
263       'device_sid' => payload['device_sid'],
264       'thumbprint' => payload['thumbprint'],
265       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
266       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
267   }
268 
269   # Context
270   @instance_context = nil
271   @params = {'fleet_sid' => fleet_sid, 'sid' => sid || @properties['sid'], }
272 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique SID that identifies this Account.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
311 def account_sid
312   @properties['account_sid']
313 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CertificateContext] CertificateContext for this CertificateInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
278 def context
279   unless @instance_context
280     @instance_context = CertificateContext.new(@version, @params['fleet_sid'], @params['sid'], )
281   end
282   @instance_context
283 end
date_created() click to toggle source

@return [Time] The date this Certificate was created.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
329 def date_created
330   @properties['date_created']
331 end
date_updated() click to toggle source

@return [Time] The date this Certificate was updated.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
335 def date_updated
336   @properties['date_updated']
337 end
delete() click to toggle source

Delete the CertificateInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
349 def delete
350   context.delete
351 end
device_sid() click to toggle source

@return [String] The unique identifier of a mapped Device.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
317 def device_sid
318   @properties['device_sid']
319 end
fetch() click to toggle source

Fetch the CertificateInstance @return [CertificateInstance] Fetched CertificateInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
342 def fetch
343   context.fetch
344 end
fleet_sid() click to toggle source

@return [String] The unique identifier of the Fleet.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
305 def fleet_sid
306   @properties['fleet_sid']
307 end
friendly_name() click to toggle source

@return [String] A human readable description for this Certificate.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
299 def friendly_name
300   @properties['friendly_name']
301 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
373 def inspect
374   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
375   "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>"
376 end
sid() click to toggle source

@return [String] A string that uniquely identifies this Certificate.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
287 def sid
288   @properties['sid']
289 end
thumbprint() click to toggle source

@return [String] A Certificate unique payload hash.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
323 def thumbprint
324   @properties['thumbprint']
325 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
366 def to_s
367   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
368   "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>"
369 end
update(friendly_name: :unset, device_sid: :unset) click to toggle source

Update the CertificateInstance @param [String] friendly_name Provides a human readable descriptive text for

this Certificate credential, up to 256 characters long.

@param [String] device_sid Provides the unique string identifier of an existing

Device to become authenticated with this Certificate credential.

@return [CertificateInstance] Updated CertificateInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
360 def update(friendly_name: :unset, device_sid: :unset)
361   context.update(friendly_name: friendly_name, device_sid: device_sid, )
362 end
url() click to toggle source

@return [String] URL of this Certificate.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
293 def url
294   @properties['url']
295 end