Class: Twilio::REST::Supersim::V1::SmsCommandContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Supersim::V1::SmsCommandContext
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/sms_command.rb
Instance Method Summary collapse
-
#fetch ⇒ SmsCommandInstance
Fetch the SmsCommandInstance.
-
#fetch_with_metadata ⇒ SmsCommandInstance
Fetch the SmsCommandInstanceMetadata.
-
#initialize(version, sid) ⇒ SmsCommandContext
constructor
Initialize the SmsCommandContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ SmsCommandContext
Initialize the SmsCommandContext
257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/supersim/v1/sms_command.rb', line 257 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/SmsCommands/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ SmsCommandInstance
Fetch the SmsCommandInstance
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/supersim/v1/sms_command.rb', line 270 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) SmsCommandInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ SmsCommandInstance
Fetch the SmsCommandInstanceMetadata
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/twilio-ruby/rest/supersim/v1/sms_command.rb', line 289 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) sms_command_instance = SmsCommandInstance.new( @version, response.body, sid: @solution[:sid], ) SmsCommandInstanceMetadata.new( @version, sms_command_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
321 322 323 324 |
# File 'lib/twilio-ruby/rest/supersim/v1/sms_command.rb', line 321 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.SmsCommandContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
314 315 316 317 |
# File 'lib/twilio-ruby/rest/supersim/v1/sms_command.rb', line 314 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.SmsCommandContext #{context}>" end |