Class: Twilio::REST::Preview::DeployedDevices::FleetContext::KeyContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::DeployedDevices::FleetContext::KeyContext
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.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 KeyInstance.
-
#fetch ⇒ KeyInstance
Fetch a KeyInstance.
-
#initialize(version, fleet_sid, sid) ⇒ KeyContext
constructor
Initialize the KeyContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ KeyInstance
Update the KeyInstance.
Constructor Details
#initialize(version, fleet_sid, sid) ⇒ KeyContext
Initialize the KeyContext
188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 188 def initialize(version, fleet_sid, sid) super(version) # Path Solution @solution = {fleet_sid: fleet_sid, sid: sid, } @uri = "/Fleets/#{@solution[:fleet_sid]}/Keys/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the KeyInstance
214 215 216 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 214 def delete @version.delete('delete', @uri) end |
#fetch ⇒ KeyInstance
Fetch a KeyInstance
199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 199 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) KeyInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
246 247 248 249 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 246 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.DeployedDevices.KeyContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
239 240 241 242 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 239 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.DeployedDevices.KeyContext #{context}>" end |
#update(friendly_name: :unset, device_sid: :unset) ⇒ KeyInstance
Update the KeyInstance
225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb', line 225 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, ) KeyInstance.new(@version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |