Class: Twilio::REST::Microvisor::V1::DeviceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Microvisor::V1::DeviceContext
- Defined in:
- lib/twilio-ruby/rest/microvisor/v1/device.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
-
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance.
-
#initialize(version, sid) ⇒ DeviceContext
constructor
Initialize the DeviceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(unique_name: :unset, target_app: :unset, logging_enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance.
Constructor Details
#initialize(version, sid) ⇒ DeviceContext
Initialize the DeviceContext
154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 154 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Devices/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ DeviceInstance
Fetch the DeviceInstance
165 166 167 168 169 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 165 def fetch payload = @version.fetch('GET', @uri) DeviceInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
201 202 203 204 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 201 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Microvisor.V1.DeviceContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
194 195 196 197 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 194 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Microvisor.V1.DeviceContext #{context}>" end |
#update(unique_name: :unset, target_app: :unset, logging_enabled: :unset) ⇒ DeviceInstance
Update the DeviceInstance
180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/twilio-ruby/rest/microvisor/v1/device.rb', line 180 def update(unique_name: :unset, target_app: :unset, logging_enabled: :unset) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'TargetApp' => target_app, 'LoggingEnabled' => logging_enabled, }) payload = @version.update('POST', @uri, data: data) DeviceInstance.new(@version, payload, sid: @solution[:sid], ) end |