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

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

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

  • account_sid (String)

    The SID of the Account that created this Fleet resource.

  • sid (String) (defaults to: nil)

    The SID of the Call 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
# 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'] == nil ? payload['data_limit'] : payload['data_limit'].to_i,
        'data_metering' => payload['data_metering'],
        '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'],
        'ip_commands_url' => payload['ip_commands_url'],
        'ip_commands_method' => payload['ip_commands_method'],
    }

    # 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 Fleet resource.

Returns:



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

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



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

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 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to ‘true`.

Returns:

  • (Boolean)

    Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to ‘true`.



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

def data_enabled
    @properties['data_enabled']
end

#data_limitString

Returns The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 250MB.

Returns:

  • (String)

    The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 250MB.



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

def data_limit
    @properties['data_limit']
end

#data_meteringDataMetering

Returns:

  • (DataMetering)


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

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



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

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:



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

def date_updated
    @properties['date_updated']
end

#fetchFleetInstance

Fetch the FleetInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#ip_commands_methodString

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

Returns:

  • (String)

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



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

def ip_commands_method
    @properties['ip_commands_method']
end

#ip_commands_urlString

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

Returns:

  • (String)

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



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

def ip_commands_url
    @properties['ip_commands_url']
end

#network_access_profile_sidString

Returns The SID of the Network Access Profile that controls which cellular networks the Fleet’s SIMs can connect to.

Returns:

  • (String)

    The SID of the Network Access Profile that controls which cellular networks the Fleet’s SIMs can connect to.



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

def network_access_profile_sid
    @properties['network_access_profile_sid']
end

#sidString

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

Returns:

  • (String)

    The unique string that we created to identify the Fleet resource.



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

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. Defaults to ‘false`.

Returns:

  • (Boolean)

    Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to ‘false`.



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

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`. Can be one of `POST` or `GET`. Defaults to `POST`.

Returns:

  • (String)

    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`.



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

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. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.



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

def sms_commands_url
    @properties['sms_commands_url']
end

#to_sObject

Provide a user friendly representation



470
471
472
473
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 470

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



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

def unique_name
    @properties['unique_name']
end

#update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset, data_limit: :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.

  • ip_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 IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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

    A string representing the HTTP method to use when making a request to ‘ip_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`.

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

    The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000).

Returns:



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 447

def update(
    unique_name: :unset, 
    network_access_profile: :unset, 
    ip_commands_url: :unset, 
    ip_commands_method: :unset, 
    sms_commands_url: :unset, 
    sms_commands_method: :unset, 
    data_limit: :unset
)

    context.update(
        unique_name: unique_name, 
        network_access_profile: network_access_profile, 
        ip_commands_url: ip_commands_url, 
        ip_commands_method: ip_commands_method, 
        sms_commands_url: sms_commands_url, 
        sms_commands_method: sms_commands_method, 
        data_limit: data_limit, 
    )
end

#urlString

Returns The absolute URL of the Fleet resource.

Returns:

  • (String)

    The absolute URL of the Fleet resource.



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

def url
    @properties['url']
end