Class: Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateContext
- 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
-
#delete ⇒ Boolean
Deletes the CertificateInstance.
-
#fetch ⇒ CertificateInstance
Fetch a CertificateInstance.
-
#initialize(version, fleet_sid, sid) ⇒ CertificateContext
constructor
Initialize the CertificateContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance.
Constructor Details
#initialize(version, fleet_sid, sid) ⇒ CertificateContext
Initialize the CertificateContext
194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 194 def initialize(version, fleet_sid, sid) super(version) # Path Solution @solution = {fleet_sid: fleet_sid, sid: sid, } @uri = "/Fleets/#{@solution[:fleet_sid]}/Certificates/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the CertificateInstance
220 221 222 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 220 def delete @version.delete('delete', @uri) end |
#fetch ⇒ CertificateInstance
Fetch a CertificateInstance
205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 205 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) CertificateInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 252 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 245 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.DeployedDevices.CertificateContext #{context}>" end |
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance
231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 231 def update(friendly_name: :unset, device_sid: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, 'DeviceSid' => device_sid, }) payload = @version.update( 'POST', @uri, data: data, ) CertificateInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |