Class: Twilio::REST::Supersim::V1::NetworkInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/supersim/v1/network.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ NetworkInstance

Initialize the NetworkInstance

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 Network resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 228

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

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

Instance Method Details

#contextNetworkContext

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

Returns:



249
250
251
252
253
254
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 249

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

#fetchNetworkInstance

Fetch the NetworkInstance

Returns:



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

def fetch

    context.fetch
end

#friendly_nameString

Returns A human readable identifier of this resource.

Returns:

  • (String)

    A human readable identifier of this resource.



264
265
266
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 264

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:



282
283
284
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 282

def identifiers
    @properties['identifiers']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#iso_countryString

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

Returns:



276
277
278
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 276

def iso_country
    @properties['iso_country']
end

#sidString

Returns The unique string that we created to identify the Network resource.

Returns:

  • (String)

    The unique string that we created to identify the Network resource.



258
259
260
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 258

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns The absolute URL of the Network resource.

Returns:

  • (String)

    The absolute URL of the Network resource.



270
271
272
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 270

def url
    @properties['url']
end