Class: Twilio::REST::Supersim::V1::FleetInstance

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

Initialize the FleetInstance

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


301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 301

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'sid' => payload['sid'],
      'unique_name' => payload['unique_name'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
      'data_enabled' => payload['data_enabled'],
      'data_limit' => payload['data_limit'].to_i,
      'data_metering' => payload['data_metering'],
      'commands_enabled' => payload['commands_enabled'],
      'commands_url' => payload['commands_url'],
      'commands_method' => payload['commands_method'],
      'sms_commands_enabled' => payload['sms_commands_enabled'],
      'sms_commands_url' => payload['sms_commands_url'],
      'sms_commands_method' => payload['sms_commands_method'],
      'network_access_profile_sid' => payload['network_access_profile_sid'],
  }

  # 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


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

def 
  @properties['account_sid']
end

#commands_enabledBoolean

Returns Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands.

Returns:

  • (Boolean)

    Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands


396
397
398
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 396

def commands_enabled
  @properties['commands_enabled']
end

#commands_methodString

Returns A string representing the HTTP method to use when making a request to `commands_url`.

Returns:

  • (String)

    A string representing the HTTP method to use when making a request to `commands_url`


408
409
410
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 408

def commands_method
  @properties['commands_method']
end

#commands_urlString

Returns The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the Commands number.

Returns:

  • (String)

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the Commands number


402
403
404
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 402

def commands_url
  @properties['commands_url']
end

#contextFleetContext

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

Returns:


333
334
335
336
337
338
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 333

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

#data_enabledBoolean

Returns Defines whether SIMs in the Fleet are capable of using data connectivity.

Returns:

  • (Boolean)

    Defines whether SIMs in the Fleet are capable of using data connectivity


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

def data_enabled
  @properties['data_enabled']
end

#data_limitString

Returns The total data usage (download and upload combined) in Megabytes that each Sim resource assigned to the Fleet resource can consume.

Returns:

  • (String)

    The total data usage (download and upload combined) in Megabytes that each Sim resource assigned to the Fleet resource can consume


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

def data_limit
  @properties['data_limit']
end

#data_meteringfleet.DataMetering

Returns The model by which a SIM is metered and billed.

Returns:

  • (fleet.DataMetering)

    The model by which a SIM is metered and billed


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

def data_metering
  @properties['data_metering']
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


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

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


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

def date_updated
  @properties['date_updated']
end

#fetchFleetInstance

Fetch the FleetInstance

Returns:


439
440
441
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 439

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


486
487
488
489
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 486

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

#network_access_profile_sidString

Returns The SID of the Network Access Profile of the Fleet.

Returns:

  • (String)

    The SID of the Network Access Profile of the Fleet


432
433
434
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 432

def network_access_profile_sid
  @properties['network_access_profile_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


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

def sid
  @properties['sid']
end

#sms_commands_enabledBoolean

Returns Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands.

Returns:

  • (Boolean)

    Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands


414
415
416
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 414

def sms_commands_enabled
  @properties['sms_commands_enabled']
end

#sms_commands_methodString

Returns A string representing the HTTP method to use when making a request to `sms_commands_url`.

Returns:

  • (String)

    A string representing the HTTP method to use when making a request to `sms_commands_url`


426
427
428
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 426

def sms_commands_method
  @properties['sms_commands_method']
end

#sms_commands_urlString

Returns The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number.

Returns:

  • (String)

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number


420
421
422
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 420

def sms_commands_url
  @properties['sms_commands_url']
end

#to_sObject

Provide a user friendly representation


479
480
481
482
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 479

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

#unique_nameString

Returns An application-defined string that uniquely identifies the resource.

Returns:

  • (String)

    An application-defined string that uniquely identifies the resource


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

def unique_name
  @properties['unique_name']
end

#update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset) ⇒ FleetInstance

Update the FleetInstance

Parameters:

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

    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.

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

    The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.

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

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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

    A string representing the HTTP method to use when making a request to `commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

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

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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

    A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

Returns:


466
467
468
469
470
471
472
473
474
475
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 466

def update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
  context.update(
      unique_name: unique_name,
      network_access_profile: network_access_profile,
      commands_url: commands_url,
      commands_method: commands_method,
      sms_commands_url: sms_commands_url,
      sms_commands_method: sms_commands_method,
  )
end

#urlString

Returns The absolute URL of the Fleet resource.

Returns:

  • (String)

    The absolute URL of the Fleet resource


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

def url
  @properties['url']
end