Class: Twilio::REST::Supersim::V1::IpCommandInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the IpCommandInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 493

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'sim_sid' => payload['sim_sid'],
        'sim_iccid' => payload['sim_iccid'],
        'status' => payload['status'],
        'direction' => payload['direction'],
        'device_ip' => payload['device_ip'],
        'device_port' => payload['device_port'] == nil ? payload['device_port'] : payload['device_port'].to_i,
        'payload_type' => payload['payload_type'],
        'payload' => payload['payload'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

    # 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 created the IP Command resource.

Returns:



538
539
540
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 538

def 
    @properties['account_sid']
end

#contextIpCommandContext

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

Returns:



523
524
525
526
527
528
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 523

def context
    unless @instance_context
        @instance_context = IpCommandContext.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:



592
593
594
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 592

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:



598
599
600
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 598

def date_updated
    @properties['date_updated']
end

#device_ipString

Returns The IP address of the device that the IP Command was sent to or received from. For an IP Command sent to a Super SIM, device_ip starts out as null, and once the IP Command is “sent”, the device_ip will be filled out. An IP Command sent from a Super SIM have its device_ip always set.

Returns:

  • (String)

    The IP address of the device that the IP Command was sent to or received from. For an IP Command sent to a Super SIM, device_ip starts out as null, and once the IP Command is “sent”, the device_ip will be filled out. An IP Command sent from a Super SIM have its device_ip always set.



568
569
570
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 568

def device_ip
    @properties['device_ip']
end

#device_portString

Returns For an IP Command sent to a Super SIM, it would be the destination port of the IP message. For an IP Command sent from a Super SIM, it would be the source port of the IP message.

Returns:

  • (String)

    For an IP Command sent to a Super SIM, it would be the destination port of the IP message. For an IP Command sent from a Super SIM, it would be the source port of the IP message.



574
575
576
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 574

def device_port
    @properties['device_port']
end

#directionDirection

Returns:

  • (Direction)


562
563
564
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 562

def direction
    @properties['direction']
end

#fetchIpCommandInstance

Fetch the IpCommandInstance

Returns:



611
612
613
614
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 611

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



625
626
627
628
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 625

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

#payloadString

Returns The payload that is carried in the IP/UDP message. The payload can be encoded in either text or binary format. For text payload, UTF-8 encoding must be used. For an IP Command sent to a Super SIM, the payload is appended to the IP/UDP message “as is”. The payload should not exceed 1300 bytes. For an IP Command sent from a Super SIM, the payload from the received IP/UDP message is extracted and sent in binary encoding. For an IP Command sent from a Super SIM, the payload should not exceed 1300 bytes. If it is larger than 1300 bytes, there might be fragmentation on the upstream and the message may appear truncated.

Returns:

  • (String)

    The payload that is carried in the IP/UDP message. The payload can be encoded in either text or binary format. For text payload, UTF-8 encoding must be used. For an IP Command sent to a Super SIM, the payload is appended to the IP/UDP message “as is”. The payload should not exceed 1300 bytes. For an IP Command sent from a Super SIM, the payload from the received IP/UDP message is extracted and sent in binary encoding. For an IP Command sent from a Super SIM, the payload should not exceed 1300 bytes. If it is larger than 1300 bytes, there might be fragmentation on the upstream and the message may appear truncated.



586
587
588
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 586

def payload
    @properties['payload']
end

#payload_typePayloadType

Returns:

  • (PayloadType)


580
581
582
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 580

def payload_type
    @properties['payload_type']
end

#sidString

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

Returns:

  • (String)

    The unique string that we created to identify the IP Command resource.



532
533
534
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 532

def sid
    @properties['sid']
end

#sim_iccidString

Returns The [ICCID](en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the [Super SIM](www.twilio.com/docs/iot/supersim/api/sim-resource) that this IP Command was sent to or from.

Returns:



550
551
552
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 550

def sim_iccid
    @properties['sim_iccid']
end

#sim_sidString

Returns The SID of the [Super SIM](www.twilio.com/docs/iot/supersim/api/sim-resource) that this IP Command was sent to or from.

Returns:



544
545
546
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 544

def sim_sid
    @properties['sim_sid']
end

#statusStatus

Returns:

  • (Status)


556
557
558
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 556

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



618
619
620
621
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 618

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

#urlString

Returns The absolute URL of the IP Command resource.

Returns:

  • (String)

    The absolute URL of the IP Command resource.



604
605
606
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 604

def url
    @properties['url']
end