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



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 317

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



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

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



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

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

#data_enabledBoolean



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

def data_enabled
    @properties['data_enabled']
end

#data_limitString



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

def data_limit
    @properties['data_limit']
end

#data_meteringDataMetering



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

def data_metering
    @properties['data_metering']
end

#date_createdTime



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

def date_created
    @properties['date_created']
end

#date_updatedTime



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

def date_updated
    @properties['date_updated']
end

#fetchFleetInstance

Fetch the FleetInstance



448
449
450
451
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 448

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



493
494
495
496
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 493

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

#ip_commands_methodString



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

def ip_commands_method
    @properties['ip_commands_method']
end

#ip_commands_urlString



435
436
437
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 435

def ip_commands_url
    @properties['ip_commands_url']
end

#network_access_profile_sidString



429
430
431
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 429

def network_access_profile_sid
    @properties['network_access_profile_sid']
end

#sidString



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

def sid
    @properties['sid']
end

#sms_commands_enabledBoolean



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

def sms_commands_enabled
    @properties['sms_commands_enabled']
end

#sms_commands_methodString



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

def sms_commands_method
    @properties['sms_commands_method']
end

#sms_commands_urlString



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

def sms_commands_url
    @properties['sms_commands_url']
end

#to_sObject

Provide a user friendly representation



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

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

#unique_nameString



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

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



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 463

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



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

def url
    @properties['url']
end