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
285 286 287 288 289 290 291 292 293 294 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 285 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/IpCommands/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ IpCommandInstance
Fetch the IpCommandInstance
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 298 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
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 317 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
349 350 351 352 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 349 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.IpCommandContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 342 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.IpCommandContext #{context}>" end |