Class: Twilio::REST::Supersim::V1::NetworkAccessProfileInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the NetworkAccessProfileInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 272

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'unique_name' => payload['unique_name'],
        'account_sid' => payload['account_sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that the Network Access Profile belongs to.

Returns:



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

def 
    @properties['account_sid']
end

#contextNetworkAccessProfileContext

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

Returns:



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

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

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



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

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



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

def date_updated
    @properties['date_updated']
end

#fetchNetworkAccessProfileInstance

Fetch the NetworkAccessProfileInstance

Returns:



347
348
349
350
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 347

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



381
382
383
384
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 381

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

Returns:

  • (Hash)


340
341
342
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 340

def links
    @properties['links']
end

#networksnetworks

Access the networks

Returns:



368
369
370
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 368

def networks
    context.networks
end

#sidString

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

Returns:

  • (String)

    The unique string that identifies the Network Access Profile resource.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



374
375
376
377
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 374

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

#unique_nameString

Returns An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s ‘sid` in the URL to address the resource.

Returns:

  • (String)

    An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s ‘sid` in the URL to address the resource.



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

def unique_name
    @properties['unique_name']
end

#update(unique_name: :unset) ⇒ NetworkAccessProfileInstance

Update the NetworkAccessProfileInstance

Parameters:

  • unique_name (String) (defaults to: :unset)

    The new unique name of the Network Access Profile.

Returns:



356
357
358
359
360
361
362
363
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 356

def update(
    unique_name: :unset
)

    context.update(
        unique_name: unique_name, 
    )
end

#urlString

Returns The absolute URL of the Network Access Profile resource.

Returns:

  • (String)

    The absolute URL of the Network Access Profile resource.



334
335
336
# File 'lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb', line 334

def url
    @properties['url']
end