Class: Twilio::REST::Preview::DeployedDevices::FleetInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/deployed_devices/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.



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 340

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'url' => payload['url'],
        'unique_name' => payload['unique_name'],
        'friendly_name' => payload['friendly_name'],
        'account_sid' => payload['account_sid'],
        'default_deployment_sid' => payload['default_deployment_sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns Speicifies the unique string identifier of the Account responsible for this Fleet.

Returns:

  • (String)

    Speicifies the unique string identifier of the Account responsible for this Fleet.



398
399
400
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 398

def 
    @properties['account_sid']
end

#certificatescertificates

Access the certificates

Returns:



482
483
484
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 482

def certificates
    context.certificates
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:



365
366
367
368
369
370
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 365

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

#date_createdTime

Returns Specifies the date this Fleet was created, given in UTC ISO 8601 format.

Returns:

  • (Time)

    Specifies the date this Fleet was created, given in UTC ISO 8601 format.



410
411
412
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 410

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns Specifies the date this Fleet was last updated, given in UTC ISO 8601 format.

Returns:

  • (Time)

    Specifies the date this Fleet was last updated, given in UTC ISO 8601 format.



416
417
418
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 416

def date_updated
    @properties['date_updated']
end

#default_deployment_sidString

Returns Contains the string identifier of the automatically provisioned default Deployment of this Fleet.

Returns:

  • (String)

    Contains the string identifier of the automatically provisioned default Deployment of this Fleet.



404
405
406
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 404

def default_deployment_sid
    @properties['default_deployment_sid']
end

#deleteBoolean

Delete the FleetInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



429
430
431
432
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 429

def delete

    context.delete
end

#deploymentsdeployments

Access the deployments

Returns:



475
476
477
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 475

def deployments
    context.deployments
end

#devicesdevices

Access the devices

Returns:



461
462
463
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 461

def devices
    context.devices
end

#fetchFleetInstance

Fetch the FleetInstance

Returns:



437
438
439
440
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 437

def fetch

    context.fetch
end

#friendly_nameString

Returns Contains a human readable descriptive text for this Fleet, up to 256 characters long.

Returns:

  • (String)

    Contains a human readable descriptive text for this Fleet, up to 256 characters long.



392
393
394
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 392

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



495
496
497
498
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 495

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

#keyskeys

Access the keys

Returns:



468
469
470
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 468

def keys
    context.keys
end

Returns Contains a dictionary of URL links to nested resources of this Fleet.

Returns:

  • (Hash)

    Contains a dictionary of URL links to nested resources of this Fleet.



422
423
424
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 422

def links
    @properties['links']
end

#sidString

Returns Contains a 34 character string that uniquely identifies this Fleet resource.

Returns:

  • (String)

    Contains a 34 character string that uniquely identifies this Fleet resource.



374
375
376
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 374

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



488
489
490
491
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 488

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

#unique_nameString

Returns Contains a unique and addressable name of this Fleet, e.g. ‘default’, up to 128 characters long.

Returns:

  • (String)

    Contains a unique and addressable name of this Fleet, e.g. ‘default’, up to 128 characters long.



386
387
388
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 386

def unique_name
    @properties['unique_name']
end

#update(friendly_name: :unset, default_deployment_sid: :unset) ⇒ FleetInstance

Update the FleetInstance

Parameters:

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

    Provides a human readable descriptive text for this Fleet, up to 256 characters long.

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

    Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet.

Returns:



447
448
449
450
451
452
453
454
455
456
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 447

def update(
    friendly_name: :unset, 
    default_deployment_sid: :unset
)

    context.update(
        friendly_name: friendly_name, 
        default_deployment_sid: default_deployment_sid, 
    )
end

#urlString

Returns Contains an absolute URL for this Fleet resource.

Returns:

  • (String)

    Contains an absolute URL for this Fleet resource.



380
381
382
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 380

def url
    @properties['url']
end