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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this NetworkAccessProfileNetwork resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 260

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

Returns:



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

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

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

def delete

    context.delete
end

#fetchNetworkAccessProfileNetworkInstance

Fetch the NetworkAccessProfileNetworkInstance

Returns:



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

def fetch

    context.fetch
end

#friendly_nameString

Returns A human readable identifier of the Network this resource refers to.

Returns:

  • (String)

    A human readable identifier of the Network this resource refers to.



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

def friendly_name
    @properties['friendly_name']
end

#identifiersArray<Hash>

Returns Array of objects identifying the [MCC-MNCs](en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource.

Returns:



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

def identifiers
    @properties['identifiers']
end

#inspectObject

Provide a detailed, user friendly representation



350
351
352
353
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 350

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

#iso_countryString

Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource.

Returns:



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

def iso_country
    @properties['iso_country']
end

#network_access_profile_sidString

Returns The unique string that identifies the Network resource’s Network Access Profile resource.

Returns:

  • (String)

    The unique string that identifies the Network resource’s Network Access Profile resource.



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

def network_access_profile_sid
    @properties['network_access_profile_sid']
end

#sidString

Returns The unique string that identifies the Network resource.

Returns:

  • (String)

    The unique string that identifies the Network resource.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



343
344
345
346
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 343

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

#urlString

Returns The absolute URL of the Network resource.

Returns:

  • (String)

    The absolute URL of the Network resource.



321
322
323
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb', line 321

def url
    @properties['url']
end