Class: Twilio::REST::Supersim::V1::NetworkAccessProfileContext::NetworkAccessProfileNetworkInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, network_access_profile_sid: nil, sid: nil) ⇒ NetworkAccessProfileNetworkInstance

Initialize the NetworkAccessProfileNetworkInstance



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 247

def initialize(version, payload , network_access_profile_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'network_access_profile_sid' => payload['network_access_profile_sid'],
        'friendly_name' => payload['friendly_name'],
        'iso_country' => payload['iso_country'],
        'identifiers' => payload['identifiers'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'network_access_profile_sid' => network_access_profile_sid  || @properties['network_access_profile_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#contextNetworkAccessProfileNetworkContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



269
270
271
272
273
274
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 269

def context
    unless @instance_context
        @instance_context = NetworkAccessProfileNetworkContext.new(@version , @params['network_access_profile_sid'], @params['sid'])
    end
    @instance_context
end

#deleteBoolean

Delete the NetworkAccessProfileNetworkInstance



315
316
317
318
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 315

def delete

    context.delete
end

#fetchNetworkAccessProfileNetworkInstance

Fetch the NetworkAccessProfileNetworkInstance



323
324
325
326
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 323

def fetch

    context.fetch
end

#friendly_nameString



290
291
292
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 290

def friendly_name
    @properties['friendly_name']
end

#identifiersArray<Hash>



302
303
304
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 302

def identifiers
    @properties['identifiers']
end

#inspectObject

Provide a detailed, user friendly representation



337
338
339
340
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 337

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance #{values}>"
end

#iso_countryString



296
297
298
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 296

def iso_country
    @properties['iso_country']
end

#network_access_profile_sidString



284
285
286
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 284

def network_access_profile_sid
    @properties['network_access_profile_sid']
end

#sidString



278
279
280
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 278

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



330
331
332
333
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 330

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance #{values}>"
end

#urlString



308
309
310
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 308

def url
    @properties['url']
end