Class: Twilio::REST::Supersim::V1::IpCommandContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Supersim::V1::IpCommandContext
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/ip_command.rb
Instance Method Summary collapse
-
#fetch ⇒ IpCommandInstance
Fetch the IpCommandInstance.
-
#fetch_with_metadata ⇒ IpCommandInstance
Fetch the IpCommandInstanceMetadata.
-
#initialize(version, sid) ⇒ IpCommandContext
constructor
Initialize the IpCommandContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ IpCommandContext
Initialize the IpCommandContext
277 278 279 280 281 282 283 284 285 286 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 277 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/IpCommands/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ IpCommandInstance
Fetch the IpCommandInstance
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 290 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) IpCommandInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ IpCommandInstance
Fetch the IpCommandInstanceMetadata
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 309 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) ip_command_instance = IpCommandInstance.new( @version, response.body, sid: @solution[:sid], ) IpCommandInstanceMetadata.new( @version, ip_command_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
341 342 343 344 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 341 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.IpCommandContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
334 335 336 337 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 334 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.IpCommandContext #{context}>" end |