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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • sid (String) (defaults to: nil)

    The SID of the Network resource to fetch.


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

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:


246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 246

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

#fetchNetworkInstance

Fetch the NetworkInstance

Returns:


286
287
288
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 286

def fetch
  context.fetch
end

#friendly_nameString

Returns A human readable identifier of this resource.

Returns:

  • (String)

    A human readable identifier of this resource


261
262
263
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 261

def friendly_name
  @properties['friendly_name']
end

#identifiersArray[Hash]

Returns The MCC/MNCs included in the Network resource.

Returns:

  • (Array[Hash])

    The MCC/MNCs included in the Network resource


279
280
281
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 279

def identifiers
  @properties['identifiers']
end

#inspectObject

Provide a detailed, user friendly representation


299
300
301
302
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 299

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

#iso_countryString

Returns The ISO country code of the Network resource.

Returns:

  • (String)

    The ISO country code of the Network resource


273
274
275
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 273

def iso_country
  @properties['iso_country']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


255
256
257
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 255

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


292
293
294
295
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 292

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


267
268
269
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 267

def url
  @properties['url']
end