Class: Twilio::REST::Supersim::V1::NetworkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Supersim::V1::NetworkInstance
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/network.rb
Instance Method Summary collapse
-
#context ⇒ NetworkContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ NetworkInstance
Fetch the NetworkInstance.
-
#friendly_name ⇒ String
A human readable identifier of this resource.
-
#identifiers ⇒ Array<Hash>
Array of objects identifying the [MCC-MNCs](en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource.
-
#initialize(version, payload, sid: nil) ⇒ NetworkInstance
constructor
Initialize the NetworkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource.
-
#sid ⇒ String
The unique string that we created to identify the Network resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Network resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ NetworkInstance
Initialize the NetworkInstance
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 236 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
#context ⇒ NetworkContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
257 258 259 260 261 262 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 257 def context unless @instance_context @instance_context = NetworkContext.new(@version , @params['sid']) end @instance_context end |
#fetch ⇒ NetworkInstance
Fetch the NetworkInstance
297 298 299 300 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 297 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable identifier of this resource.
272 273 274 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 272 def friendly_name @properties['friendly_name'] end |
#identifiers ⇒ Array<Hash>
Returns Array of objects identifying the [MCC-MNCs](en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource.
290 291 292 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 290 def identifiers @properties['identifiers'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
311 312 313 314 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 311 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Supersim.V1.NetworkInstance #{values}>" end |
#iso_country ⇒ String
Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource.
284 285 286 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 284 def iso_country @properties['iso_country'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Network resource.
266 267 268 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 266 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
304 305 306 307 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 304 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Supersim.V1.NetworkInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Network resource.
278 279 280 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 278 def url @properties['url'] end |