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

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/supersim/v1/ip_command.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) ⇒ IpCommandInstance

Initialize the IpCommandInstance

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 IP Command resource to fetch.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 281

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 that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



325
326
327
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 325

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:



310
311
312
313
314
315
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 310

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

#date_createdTime

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was created



379
380
381
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 379

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The ISO 8601 date and time in GMT when the resource was last updated.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was last updated



385
386
387
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 385

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.

Returns:

  • (String)

    The IP address of the device that the IP Command was sent to or received from



355
356
357
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 355

def device_ip
  @properties['device_ip']
end

#device_portString

Returns The port that the IP Command either originated from or was sent to.

Returns:

  • (String)

    The port that the IP Command either originated from or was sent to



361
362
363
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 361

def device_port
  @properties['device_port']
end

#directionip_command.Direction

Returns The direction of the IP Command.

Returns:

  • (ip_command.Direction)

    The direction of the IP Command



349
350
351
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 349

def direction
  @properties['direction']
end

#fetchIpCommandInstance

Fetch the IpCommandInstance

Returns:



398
399
400
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 398

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



411
412
413
414
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 411

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

#payloadString

Returns The payload of the IP Command sent to or from the Super SIM.

Returns:

  • (String)

    The payload of the IP Command sent to or from the Super SIM



373
374
375
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 373

def payload
  @properties['payload']
end

#payload_typeip_command.PayloadType

Returns The payload type of the IP Command.

Returns:

  • (ip_command.PayloadType)

    The payload type of the IP Command



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

def payload_type
  @properties['payload_type']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



319
320
321
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 319

def sid
  @properties['sid']
end

#sim_iccidString

Returns The ICCID of the Super SIM that this IP Command was sent to or from.

Returns:

  • (String)

    The ICCID of the Super SIM that this IP Command was sent to or from



337
338
339
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 337

def sim_iccid
  @properties['sim_iccid']
end

#sim_sidString

Returns The SID of the Super SIM that this IP Command was sent to or from.

Returns:

  • (String)

    The SID of the Super SIM that this IP Command was sent to or from



331
332
333
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 331

def sim_sid
  @properties['sim_sid']
end

#statusip_command.Status

Returns The status of the IP Command.

Returns:

  • (ip_command.Status)

    The status of the IP Command



343
344
345
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 343

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



404
405
406
407
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 404

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



391
392
393
# File 'lib/twilio-ruby/rest/supersim/v1/ip_command.rb', line 391

def url
  @properties['url']
end