class Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateContext

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, fleet_sid, sid) click to toggle source

Initialize the CertificateContext @param [Version] version Version that contains the resource @param [String] fleet_sid The fleet_sid @param [String] sid Provides a 34 character string that uniquely identifies the

requested Certificate credential resource.

@return [CertificateContext] CertificateContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
187 def initialize(version, fleet_sid, sid)
188   super(version)
189 
190   # Path Solution
191   @solution = {fleet_sid: fleet_sid, sid: sid, }
192   @uri = "/Fleets/#{@solution[:fleet_sid]}/Certificates/#{@solution[:sid]}"
193 end

Public Instance Methods

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
207 def delete
208    @version.delete('DELETE', @uri)
209 end
fetch() click to toggle source

Fetch the CertificateInstance @return [CertificateInstance] Fetched CertificateInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
198 def fetch
199   payload = @version.fetch('GET', @uri)
200 
201   CertificateInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], )
202 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
235 def inspect
236   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
237   "#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>"
238 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
228 def to_s
229   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
230   "#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>"
231 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
218 def update(friendly_name: :unset, device_sid: :unset)
219   data = Twilio::Values.of({'FriendlyName' => friendly_name, 'DeviceSid' => device_sid, })
220 
221   payload = @version.update('POST', @uri, data: data)
222 
223   CertificateInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], )
224 end