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
257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 257 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/ESimProfiles/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ EsimProfileInstance
Fetch the EsimProfileInstance
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 270 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
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/esim_profile.rb', line 289 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
321 322 323 324 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 321 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.EsimProfileContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
314 315 316 317 |
# File 'lib/twilio-ruby/rest/supersim/v1/esim_profile.rb', line 314 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.EsimProfileContext #{context}>" end |