Class: Twilio::REST::Supersim::V1::EsimProfileContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Supersim::V1::EsimProfileContext
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/esim_profile.rb
Instance Method Summary collapse
-
#fetch ⇒ EsimProfileInstance
Fetch the EsimProfileInstance.
-
#fetch_with_metadata ⇒ EsimProfileInstance
Fetch the EsimProfileInstanceMetadata.
-
#initialize(version, sid) ⇒ EsimProfileContext
constructor
Initialize the EsimProfileContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ EsimProfileContext
Initialize the EsimProfileContext
265 266 267 268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 265 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/ESimProfiles/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ EsimProfileInstance
Fetch the EsimProfileInstance
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 278 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EsimProfileInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ EsimProfileInstance
Fetch the EsimProfileInstanceMetadata
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 297 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) esim_profile_instance = EsimProfileInstance.new( @version, response.body, sid: @solution[:sid], ) EsimProfileInstanceMetadata.new( @version, esim_profile_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
329 330 331 332 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 329 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.EsimProfileContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
322 323 324 325 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 322 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.EsimProfileContext #{context}>" end |